When the program asynchronously commits, and returns is the return JSON, the time that you receive in this JS is likely to be this way: "/date (1400046388387)/", this is a string.
Of course, you can't just show him on the page and format him: The method of collecting online is recorded here:
1. First convert the return value to JS date type
2, using the Format method of date formatted output (This format method is self-expanding)
var str = '/date (1400046388387)/'; var d = eval (' new ' + str.substr (1, str.length-2)); New Date () D.format ("Yyyy-mm-dd hh:mm:ss") Date.prototype.Format = function (FMT) {//author:meizz var o = { "m+ ": This.getmonth () + 1,//month " d+ ": this.getdate (),//day " H + ": this.gethours (),//hour " m+ ": this.getminutes (), Sub "s+": This.getseconds (),//sec "q+": Math.floor ((This.getmonth () + 3)/3),//quarterly "s": This.getmilliseconds ()//msec }; if (/(y+)/.test (FMT)) FMT = Fmt.replace (regexp.$1, (this.getfullyear () + ""). substr (4-regexp.$1.length)); For (var k in O) if (New RegExp ("(" + K +) "). Test (FMT)) FMT = Fmt.replace (regexp.$1, (regexp.$1.length = = 1)? (O[k]): (("XX" + o[k]). substr (("" + O[k]).)); return FMT;}
If it is not JSON return, preferably in the background with C # ToString ("Yyyy-mm-dd hh:mm:ss") way to transfer to the foreground, without JS conversion.
JS formatted Date ("/date (1400046388387)/")