Skip to content

Instantly share code, notes, and snippets.

@CodeByAidan
Created October 31, 2022 03:01
Show Gist options
  • Save CodeByAidan/12ffc37744615acfe4bef18feb2cb832 to your computer and use it in GitHub Desktop.
Save CodeByAidan/12ffc37744615acfe4bef18feb2cb832 to your computer and use it in GitHub Desktop.
Simple bookmarklet that turns entire page to current time & updates constantly. It uses 12-hour formatting!
javascript:var t=setInterval(function(){var d=new Date();var h=d.getHours();var m=d.getMinutes();var s=d.getSeconds();var ampm=h>=12?'pm':'am';h=h%12;h=h?h:12;m=m<10?'0'+m:m;s=s<10?'0'+s:s;var strTime=h+':'+m+':'+s+' '+ampm;document.body.innerHTML=strTime;},1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment