Ensure 3 digits in milliseconds of ISO-date


This is proberbly a bug in IE 9, but dates in the format of
2012-07-27T17:13:56.44+02:00 will parse to NaN
2012-07-27T17:13:56.440+02:00 however works fine
Closed Feb 2, 2013 at 1:02 AM by JamesNK
The next version of Json.NET will have DateFormatString on JsonSerializerSettings. Set it to @"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK" and you will always get 3 millisecond digits.


scda0001 wrote Aug 17, 2012 at 2:42 PM

Same problem here. Any workaround for this?


Damiano wrote Oct 15, 2012 at 1:02 PM

Please ensure 3 digit if milliseconds are provided

simone_b wrote Jan 7, 2013 at 11:24 PM

This is indeed a problem with JSON.NET. At times a DateTime value is serialized with milliseconds chopped to two digits rather than three, which is easy to spot if on the client side you are using IE (tried with IE9) and do new Date(your JSON.NET serialized date string). The workarounds are straightforward, but this is a bug.