Convert unix timestamp to javascript date Object
This question already has an answer here:
Duplicate of How to format a JSON date?.
Accepted solution was:
var date = new Date(parseInt(jsonDate.substr(6)));
Try something like this:-
var d = new Date(unix_timestamp*1000);
or
var d = new Date([UNIX Timestamp] * 1000);
Date
构造函数接受Unix时间戳。
function cleanDate(d) {
return new Date(+d.replace(//Date((d+))//, '$1'));
}
cleanDate("/Date(1356081900000)/"); // => Fri Dec 21 2012 04:25:00 GMT-0500 (EST)
链接地址: http://www.djcxy.com/p/8152.html
上一篇: Json Datetime问题