Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 536
mike44 Avatar asked Jun 14 '26 11:06

mike44


1 Answers

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 :)

like image 85
winner_joiner Avatar answered Jun 17 '26 00:06

winner_joiner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!