Internet Explorer, Json.Net JavaScript date and milliseconds issue

Viewed 3815

I'm not sure if it's me missing something - or IE or Json.Net.

But basically this works:

new Date("2012-08-03T12:36:54.743Z")

This fails with 'Invalid Date' error:

new Date("2012-08-03T12:36:54.74Z")

The second date is stored in SQL Server as:

2012-08-03 12:36:54.740

It is then serialised as JSON using Json.Net - Json.Net did serialised the date as 2012-08-03T12:36:54.74Z, effectively chopping off the last 0.

My question(s):

  • Is this an intended behavior in IE - that it needs to have all 3 digits in the milliseconds bit to work ?
  • Is this an intended behavior in Json.Net - that it'll always chop off the last 0 in a date ?
2 Answers
Related