Closed gbreen12 closed 3 years ago
I created a simple web api project to show the issue:
https://github.com/gbreen12/Json.Net-Deserialization
Run locally on Mac to see the local offset, run in docker to see 0 offset
Turns out I have to set the timezone on the docker container. That fixed the issue.
I'm running a .Net 5 Web API and I'm seeing different values when deserializing date time offsets.
Source/destination JSON
Expected behavior
Deserialize with local offset (or ability to specify via settings)
Actual behavior
On Mac, it is deserializing to my local offset but on linux (via Docker) it is deserializing with a 0 offset.
Steps to reproduce
Here is my docker file:
Here is my C# setup:
I've tried setting the
DateParseHandling
and theDateTimeZoneHandling
but neither fixed the issue.