Problem with json deserialization
I have an issue with deserialization of the datetime from a JSON string.
I need to deserialize
2024-07-09T10:36:23:000Z
into a datetime object, but currently, I am having a problem with deserialization.
My code looks like this:
With this error
Shoud be problem in culture setting in os? Or how can I serialize it without creating a new converter?2 Replies
the problem is your datetime string
2024-07-09T10:36:23:000Z
is not ISO 8601-1:2019
you can add your own custom converter to handle this format, if you are locked into that formatYeah, miliseconds are separated with a
.
in ISO 8601
Ideally, you'd change whatever returns that data to use proper ISO format
Failing that, as Pobiega said, custom converter