Last active
September 28, 2017 07:07
-
-
Save johnbocook/5619b074a79b8d695a07 to your computer and use it in GitHub Desktop.
Display's the current date in this format: Friday, June 11, 2015.
This file contains 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
<script language="JavaScript"> | |
var now = new Date(); | |
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); | |
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December'); | |
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); | |
function fourdigits(number) { | |
return (number < 1000) ? number + 1900 : number; | |
} | |
today = days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear())) ; | |
document.write(today); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment