Date.prototype.format = function(format) {var o ={"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-regex p.$1. length)); For (var k in O) if (New RegExp ("(" + K + ")"). Test (format)) format = Format.replace (regexp.$1, regexp.$1.length = = 1? O[k]: ("XX" + o[k]). substr (("" + O[k]). length); return format;} UTC time Conversion function Gettimebytimestr (datestr) {var Timearr = datestr.split ("T"); var d = timearr[0].split ("-" ); var t = timearr[1].split (":"); First resolved to UTC return new Date (DATE.UTC (D[0], (d[1]-1), d[2], t[0], t[1], t[2]));}
JS Extended jquery date conversion time to UTC time