The database is clearly the time to return but become a string of irregular numbers. Solving method
/**
* Time stamp Turn time format
* Number of times of @param jsondate
*/
function Getlocaltime (jsondate) {
Jsondate= "" +jsondate+ "";//Because Jsondate is a number type, indexof will complain.
if (Jsondate.indexof ("+") > 0) {
Jsondate = jsondate.substring (0, Jsondate.indexof ("+"));
}
else if (Jsondate.indexof ("-") > 0) {
Jsondate = jsondate.substring (0, Jsondate.indexof ("-"));
}
var date = new Date (parseint (Jsondate, 10));
var month = Date.getmonth () + 1 < 10? "0" + (date.getmonth () + 1): Date.getmonth () + 1;
var currentdate = date.getdate () < 10? "0" + date.getdate (): Date.getdate ();
var hours = date.gethours () < 10? "0" + date.gethours (): Date.gethours ();
var minutes = Date.getminutes () < 10? "0" + date.getminutes (): Date.getminutes ();
var seconds = date.getseconds () < 10? "0" + date.getseconds (): Date.getseconds ();
return date.getfullyear () + "-" + month + "-" + currentdate + "" + Hours + ":" + minutes + ":" + seconds;
}
Problem Solving (PS: One thing to note is that may be the number type, in JS can not use the IndexOf method, you need to add quotes into character creation format)
Reference http://www.bubuko.com/infodetail-832252.html