Last active
December 16, 2016 11:56
-
-
Save EncodeTheCode/fe6f63022fcf4208429d9d96384ef2b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function date_time(e){var t=new Date,d=t.getFullYear(),n=t.getMonth(),u=["January","February","March","April","May","June","July","August","September","October","November","December"],y=t.getDate(),o=t.getDay(),i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],s=t.getHours(),m=t.getMinutes(),g=t.getSeconds();return 10>s&&(s="0"+s),10>m&&(m="0"+m),10>g&&(g="0"+g),1==y&&(a="st"),2==y&&(a="nd"),3==y&&(a="rd"),y>=4&&(a="th"),21==y&&(a="st"),22==y&&(a="nd"),23==y&&(a="rd"),y>=24&&(a="th"),31==y&&(a="st"),r=""+i[o]+" "+u[n]+" "+y+a+" "+d+" "+s+":"+m+":"+g,document.getElementById(e).innerHTML=r,setTimeout('date_time("'+e+'");',"1000"),!0}window.onload=date_time("date_time"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment