Created
February 25, 2014 14:57
-
-
Save gregoryyoung/9210402 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var o = | |
JArray.Parse(@"[ | |
{ | |
""eventId"": ""fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4"", | |
""eventType"": ""event-type"", | |
""data"": { | |
""BirthDate"": ""1987-11-07T00:00:00.000+01:00"" | |
} | |
} | |
]"); | |
var root = o[0]["data"]; | |
Console.Write(root); | |
prints: | |
{ | |
"BirthDate": "1987-11-07T01:00:00+02:00" | |
} | |
Note MS are gone! |
And also the timezone has changed..
The default format used by Json.NET is the ISO 8601 standard: "2012-03-19T07:22Z". No microseconds there.
Doesn't matter, how should it know that is a date and not a string?
ISO date doesn't support it. See comments at (moment/moment#248). Maybe a custom date parser helps?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What result do you get with .001 ms - correct output or?