Bug 54488 - TimeZoneInfo on Linux fails with more than one rule in effect in a year
Summary: TimeZoneInfo on Linux fails with more than one rule in effect in a year
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 4.8.0 (C9)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-04-05 14:24 UTC by Jon Skeet
Modified: 2017-04-05 22:05 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Program demonstrating the problem (1.88 KB, text/x-csharp)
2017-04-05 14:24 UTC, Jon Skeet

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 54488 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Jon Skeet 2017-04-05 14:24:59 UTC
Created attachment 21215 [details]
Program demonstrating the problem

The America/Boa_Vista time zone was "interesting" in 2000. The following are the transitions in the year 2000 (and there have been none since) as per http://nodatime.org/tzvalidate/generate:

2000-02-27 03:00:00Z -04:00:00 standard -04
2000-10-08 04:00:00Z -03:00:00 daylight -03
2000-10-15 03:00:00Z -04:00:00 standard -04

The attached program lists:
- The TimeZoneInfo adjustment rules
- All the changes within the year 2000
- The offset at each hour of the UTC day 2000-10-08

Running using netcoreapp1.1 with the .NET Core SDK 1.0.1, we can't see the adjustment rules, but the dates are as expected. (The code always shows January 1st 2000, so we can see where we're starting)

Changes during 2000 (midnight UTC with a different offset from before
2000-01-01: -03:00:00
2000-02-28: -04:00:00
2000-10-09: -03:00:00
2000-10-16: -04:00:00

Likewise October 8th shows the appropriate transition:
2000-10-08T02:00Z: -04:00:00
2000-10-08T03:00Z: -04:00:00
2000-10-08T04:00Z: -03:00:00
2000-10-08T05:00Z: -03:00:00

Running using Mono, we get very different results:

2000-01-01: -03:00:00
2000-02-28: -04:00:00
2000-07-02: -03:00:00
... and no transition at all on October 8th.

The adjustment rules look correct to me - the last two are:

[1999-07-01 - 2000-0630]; Delta: 01:00:00
  DST start: Month: 10; Week: 1; Day: 3; DoW: Sunday; Time: 00:00; Fixed? True
  DST end: Month: 2; Week: 1; Day: 27; DoW: Sunday; Time: 00:00; Fixed? True
[2000-07-01 - 2000-1231]; Delta: 01:00:00
  DST start: Month: 10; Week: 1; Day: 8; DoW: Sunday; Time: 00:00; Fixed? True
  DST end: Month: 10; Week: 1; Day: 15; DoW: Sunday; Time: 00:00; Fixed? True

Does Mono ignore the final rule, as it's already got a rule that goes up to June 30th?
Comment 1 Jon Skeet 2017-04-05 22:05:24 UTC
Side note: in this case, recreating the time zone from its own rules *doesn't* affect the behaviour, unlike in bug 54480.