Reputation: 812
I'm getting values in datatable having a column of type DateTime.
After that I'm serializing it using Json.Net
.
jsonData = JsonConvert.SerializeObject(datatable);
Date in the datatable was: 2013-04-03 04:01:24.623
Which after serialization stored in jsonData
as: 2013-04-03T04:01:24.623
On my page, I'm using it as:
timeStamp = new Date(jsonRow.TimeStamp).toLocaleString(); // Here jsonRow.TimeStamp is extracted from the received json response.
In Safari
, browser, it gives error: Invalid Date
.
Upvotes: 3
Views: 264
Reputation: 14730
Here you can find a similar Problem with an accepted Solution Date parsing in javascript is different between safari and chrome
i hope this helps :)
Upvotes: 1