Date.prototype.format =function(format) {varo = {"m+": This. GetMonth () + 1,//Month"D+": This. GetDate (),// Day"H +": This. GetHours (),//Hour"m+": This. getminutes (),//minute"S+": This. getseconds (),//Second"q+": Math.floor (( This. GetMonth () + 3)/3),//Quarter"S": This. Getmilliseconds ()//Millisecond}if(/(y+)/.test (format)) format = Format.replace (regexp.$1,( This. getFullYear () + ""). substr (4-regexp.$1. length)); for(varKinchOif(NewRegExp ("(" + K + ")"). Test (format)) format= Format.replace (regexp.$1, regexp.$1.length = = 1?O[k]:("XX" + o[k]). substr ("" +O[k]) (length));returnformat;}functionDateTimeFormatter (value) {if(Value = =undefined) {return"";}/*JSON format time to JS time format*/value= Value.substr (1, value.length-2);varobj = eval (' (' + ' {date:new ' + value + '} ' + ') ');varDateValue = obj["Date"];if(Datevalue.getfullyear () < 1900) {return"";}//return DateValuereturnDatevalue.format ("Yyyy-mm-dd hh:mm:ss");}
JS GMT Format (GMT)