Skip to content

Instantly share code, notes, and snippets.

@ColtMoney
Created May 8, 2017 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ColtMoney/c7259a0d98043e03e2e1d47028b95a2e to your computer and use it in GitHub Desktop.
Save ColtMoney/c7259a0d98043e03e2e1d47028b95a2e to your computer and use it in GitHub Desktop.
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