-
Notifications
You must be signed in to change notification settings - Fork 57
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
Daylight savings time doesn't appear to be taken into account after the year 2099 #155
Comments
Upon further digging, it appears this is due to |
Ugh, sorry for that -- we should probably reconsider that choice. |
This is likely the cause of: #135. |
Maybe we should expose some API from chrono (which has a parser internally) so we can use that? |
This are two things that I hope to work on, but there are plenty of things to do first for the coming months. And I've got the basics down for a rewrite of this crate that uses rules instead of a large table of transition dates. That would reduce the size added to the binary by ca. 90% and allow us to handle dates without an arbitrary cutoff point such as 2099. |
Background
When testing with the
America/New_York
time zone, I'm seeing some surprising results when it comes to daylight savings times. Since 2007 in the United States, daylight savings time begins on the second Sunday in March at 02:00 local time. My testing shows that, for the years between 2007 and 2099 (inclusive), the following passes:Adding one day to the original
naive_dt
produces a timestamp with timezoneEDT
, which is theAmerica/New_York
timezone when daylight savings is active.However, beginning with year 2100 for datetimes on the second Sunday in March at 02:00,
TIMEZONE.from_local_datetime(&naive_dt).single()
returnsSome
and produces a datetime with the timezoneEST
, which is theAmerica/New_York
timezone when daylight savings is not active. Timestamps after this one but before the end of daylight savings within the same year continue to haveEST
timezones, even though I'd expect them to beEDT
.Is this a known limitation of chrono-tz, or am I just misunderstanding how daylight savings time should work?
Minimal Reproducible Example
Versions
rustc
: 1.70.0-nightlychrono
: 0.4.37chrono-tz
: 0.8.6The text was updated successfully, but these errors were encountered: