2013-04-04 52 views
3

我在具有DateTime类型的列的数据表中获取值。 之后,我使用Json.Net对它进行序列化。javascript中的日期分析问题

jsonData = JsonConvert.SerializeObject(datatable); 

日期在数据表为:2013-04-03 04:01:24.623 其中存储在jsonData序列化后:2013-04-03T04:01:24.623

在我的网页,我使用它作为:

timeStamp = new Date(jsonRow.TimeStamp).toLocaleString(); // Here jsonRow.TimeStamp is extracted from the received json response. 

Safari,浏览器,它会给出错误:Invalid Date

+0

我认为[这] [1]可与您的问题有所帮助。 [1]:http://stackoverflow.com/questions/6427204/date-parsing-in-javascript-is-different-between-safari-and-chrome – GLlompart 2013-04-04 10:11:16

回答