mike44
mike44

Reputation: 812

Date parse issue in javascript

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

Answers (1)

winner_joiner
winner_joiner

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

Related Questions