StevenRasmussen / EFCore.SqlServer.NodaTime

NodaTime support for EF Core
MIT License
105 stars 18 forks source link

Remove ToUniversal and just specify the DateTime Kind to UTC #2

Closed Franklin89 closed 4 years ago

Franklin89 commented 4 years ago

EF Core gets a DateTime with a DateTime Kind of Unspecified. If you use the method ToUniversal it will also change the time according to the machines time zone. Since you make sure that the time is saved in UTC with instant.ToDateTimeUtc you only need to change the kind to UTC form Unspecified. I checked the implementation in my project and it works properly now.

This fixes #1

StevenRasmussen commented 4 years ago

@Franklin89 - Good catch! Thanks