Javascript Date toFormat(format)

Description

Javascript Date toFormat(format)


Date.prototype.toFormat = function (format) {
  format = format.replace(/H/, this.getHours());
  format = format.replace(/m/, this.getMinutes());
  format = format.replace(/s/, this.getSeconds());

  return format;/*from  w  ww  . ja  v  a 2 s .c  o m*/
};

module.exports = Date;



PreviousNext

Related