Created
May 8, 2017 08:55
-
-
Save ColtMoney/c7259a0d98043e03e2e1d47028b95a2e to your computer and use it in GitHub Desktop.
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
Date.prototype.getMonthName = function() { | |
var month = ['Jan','Feb','Mar','Apr','May','Jun', | |
'Jul','Aug','Sep','Oct','Nov','Dec']; | |
return month[this.getMonth()]; | |
} | |
var today = new Date(); | |
var year = today.getFullYear(); | |
var month = today.getMonthName(); | |
var day = today.getDate(); | |
var current = month + ' ' +day + ', '+year; | |
console.log(current); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment