Nodejs Utililty Methods Date Format

List of utility methods to do Date Format

Description

The list of methods to do Date Format are organized into topic(s).

Method

simpleDateString()
Date.prototype.simpleDateString = function () {
  var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  var month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  return days[this.getDay()] + ', ' + month[this.getMonth()] + ' ' + this.getDate();
};
ToShortFormat()
Date.prototype.ToShortFormat = function()
  return formatTime(this.getHours(), this.getMinutes()) + ", " + this.toDateString();