I've got a ASP.NET WEB API project with the current latest JSON.NET NuGet package (5.0.6) and I'm experiencing the following issue.
By default the JSON .NET Formatter is configured for ASP.NET Web API and it's also configured by default to use ISO 8601 date handling.
So, when I return a simple DTO object to a client, the JSON formatter outputs a date without the trailing "Z". E.g. "2009-03-21T08:30"
However, when I have a client post some JSON to the server, the model binder fails because parsing for the above value doesn't succeed, unless I add a trailing Z.
Inspecting the modelstate on the request, it shows an error with the following message:
"Could not convert string to DateTime: 2009-03-21T08:30. Path '', line 1, position 21."
As stated above, if I add a trailing Z to the JSON, the parsing succeeds and the correct date time value is provided to the model.
PS: Not sure if this issue relates (https://json.codeplex.com/workitem/24215
Should the JSON formatter not append the "Z" or perhaps the parser support a date+time that has the "Z" omitted?
Am I doing something wrong?