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 (show other bugs)
Version: 4.8.0 (C9)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-04-05 14:24 UTC by Jon Skeet
Modified: 2017-04-05 22:05 UTC (History)
1 user (show)

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


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

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.

Note You need to log in before you can comment on or make changes to this bug.