Here you can find the source of format(format)
Date.prototype.format = function(format) { if (format === undefined) return this.toString(); var formatSeparator = format.match(/[.\/\-\s].*?/); var formatParts = format.split(/\W+/); var result = ''; for (var i=0; i<=formatParts.length; i++) { switch(formatParts[i]) { case 'd': case 'j': result += this.getDate() + formatSeparator; break;// w ww . j a v a 2 s . com case 'dd': result += (this.getDate() < 10 ? '0' : '')+this.getDate() + formatSeparator; break; case 'm': result += (this.getMonth() + 1) + formatSeparator; break; case 'mm': result += (this.getMonth() < 9 ? '0' : '')+(this.getMonth() + 1) + formatSeparator; break; case 'yy': case 'y': result += this.getFullYear() + formatSeparator; break; case 'yyyy': case 'Y': result += this.getFullYear() + formatSeparator; break; } } return result.slice(0, -1); }
Date.prototype.format = function (format) var args = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), }; ...
Date.prototype.format = function (format) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), 'H+': this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), ...
'use strict' const fs = require('fs'); const path = require('path'); Date.prototype.format = function(format) { let o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "H+": this.getHours(), "m+": this.getMinutes(), ...
Date.prototype.format = function(format) var o = { "M+" : this.getMonth() + 1, "d+" : this.getDate(), "h+" : this.getHours(), "m+" : this.getMinutes(), "s+" : this.getSeconds(), "q+" : Math.floor((this.getMonth() + 3) / 3), ...
Date.prototype.format = function(format) { var o = { "M+" : this.getMonth() + 1, "d+" : this.getDate(), "h+" : this.getHours(), "m+" : this.getMinutes(), "s+" : this.getSeconds(), "q+" : Math.floor((this.getMonth() + 3) / 3), "S" : this.getMilliseconds() ...
Date.prototype.format = function(format) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), "S": this.getMilliseconds() ...
Date.prototype.format = function (format) { format = format || "yyyy-MM-dd"; var args = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), ...
Date.prototype.format = function(format) var monName = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; var dayName = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]; var o = { "M+" : this.getMonth() + 1, "d+" : this.getDate(), "h+" : this.getHours(), "i+" : this.getHours() + 1, ...
Date.prototype.format = function(format) { var self = this; var h = self.getHours(); var m = self.getMinutes().toString(); var s = self.getSeconds().toString(); var M = (self.getMonth() + 1).toString(); var yyyy = self.getFullYear().toString(); var yy = self.getYear().toString(); var d = self.getDate().toString(); ...