Javascript JSON日期时间php对象
我向json发送一个json datetime对象,如何将其转换为datetime JS对象 PHP返回:Javascript JSON日期时间php对象,javascript,php,json,Javascript,Php,Json,我向json发送一个json datetime对象,如何将其转换为datetime JS对象 PHP返回: "date": { "lastErrors": { "warning_count":0, "warnings":[], "error_count":0, "errors":[] }, "timezone": { "name":"Europe\/Warsaw", "location": { "country_co
"date": {
"lastErrors": {
"warning_count":0,
"warnings":[],
"error_count":0,
"errors":[]
},
"timezone": {
"name":"Europe\/Warsaw",
"location": {
"country_code":"PL",
"latitude":52.25,
"longitude":21,
"comments":""
}
},
"offset":7200,
"timestamp":1399413600
}
我需要在JavaScript中花费数小时和数分钟来轻松总结和显示。使用unix时间戳从JSON转换为Datetime对象
s = '{"date":{"lastErrors":{"warning_count":0,"warnings":[],"error_count":0,"errors":[]},"timezone":{"name":"Europe\/Warsaw","location":{"country_code":"PL","latitude":52.25,"longitude":21,"comments":""}},"offset":7200,"timestamp":1399413600}}'
new Date(JSON.parse(s).date.timestamp * 1000)
-1用于不执行SO的最小搜索。