Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed handling of DateTime64 columns #90

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

MrDoe
Copy link
Contributor

@MrDoe MrDoe commented Mar 13, 2024

I fixed two major problems concerning the handling of DateTime64 data:

  • Unix timezones from the server, e.g. 'Europe/Berlin' couldn't be converted to Windows timezones like 'W. European Standard Time' when using a Windows client
  • Due to wrong DST calculations, the time of DateTimeOffset columns before 01-01-1970 was sometimes shifted and the displayed timezone offset was wrong, too. I noticed this after reading a table containing birthdates. Even the month or year was sometimes wrong, if someone was born at the end of a month or year.
    I couldn't get this to work correctly with standard .NET functions, so I integrated the NodaTime library for this.
    The problem is, that the Windows timezone database does not have historical data, only data enough to cover more recent times. So the timezones with DST have no dynamic adjustment rules before 1970-01-01. NodaTime however does include the necessary historic data to do the DST calculations right.
    See NodaTime Blog for a more deeper explanation.

Note:

  • I removed support for netcoreapp3.1 and net6.0, because I didn't want to install these legacy frameworks on my PC. Don't merge the respective line in the .csproj file, if you still want to support them.
  • The tests for DateTime and DateTime64 are still failing, because they need to be rewritten for NodaTime data types.

@victor-sushko victor-sushko self-assigned this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants