When I fetch values from a datatable that has a column of type DateTime, I then serialize it using the Json.Net
library.
jsonData = JsonConvert.SerializeObject(datatable);
The original date in the datatable was: 2013-04-03 04:01:24.623
. After serialization, it is stored in jsonData
as: 2013-04-03T04:01:24.623
.
On my webpage, I am displaying it as:
timeStamp = new Date(jsonRow.TimeStamp).toLocaleString(); // Here jsonRow.TimeStamp is extracted from the JSON response received.
However, when viewed in Safari
browser, it shows an error: Invalid Date
.