Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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