neuecc / Utf8Json

Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).
MIT License
2.36k stars 267 forks source link

Invalid datetime format #124

Closed rmg-x closed 5 years ago

rmg-x commented 5 years ago

I'm getting an exception when trying to parse the value 20181110T170224.000Z as a DateTime.

Exception Unhandled Exception: System.InvalidOperationException: invalid datetime format. value:20181110T170224.000Z at Utf8Json.Formatters.ISO8601DateTimeFormatter.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver) at Deserialize(Object[] , JsonReader& , IJsonFormatterResolver ) at Utf8Json.Formatters.CollectionFormatterBase4.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver) at Deserialize(Object[] , JsonReader& , IJsonFormatterResolver ) at Utf8Json.JsonSerializer.Deserialize[T](Byte[] bytes, Int32 offset, IJsonFormatterResolver resolver)

Tornhoof commented 5 years ago

Your format is wrong it is missing the delimiters between year,month,day and hour,minute second Correct RFC3339/ISO8601 format looks like: 2018-11-10T17:02:24.000Z See: https://www.ietf.org/rfc/rfc3339.txt 5.6

rmg-x commented 5 years ago

Hmm, you're right! I wonder why this API I'm using would return a non standard format.

Anyway, thanks! I'll close this issue now.