Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 54468 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
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 21192 [details]
Test program demonstrating issue.
Discovered in Noda Time when trying to fix https://github.com/nodatime/nodatime/issues/743
My guess is that the underlying cause is equivalent :)
Background: Europe/Malta on Linux is represented via several single-year time zone rules, including 1948, when it entered daylight saving time on Feb 29th.
Ask Europe/Malta for the UTC offset at 1948-01-01T00:00:00Z and it's fine.
Recreate the "same" time zone via TimeZoneInfo.CreateCustomTimeZone, and it fails with an exception:
System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
at System.DateTime.DateToTicks (System.Int32 year, System.Int32 month, System.Int32 day) [0x00091] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.DateTime..ctor (System.Int32 year, System.Int32 month, System.Int32 day) [0x00000] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.TimeZoneInfo.TransitionPoint (System.TimeZoneInfo+TransitionTime transition, System.Int32 year) [0x0001b] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.TimeZoneInfo.IsInDSTForYear (System.TimeZoneInfo+AdjustmentRule rule, System.DateTime dateTime, System.Int32 year) [0x00006] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.TimeZoneInfo.IsInDST (System.TimeZoneInfo+AdjustmentRule rule, System.DateTime dateTime) [0x0002d] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.TimeZoneInfo.GetUtcOffsetHelper (System.DateTime dateTime, System.TimeZoneInfo tz, System.Boolean& isDST) [0x0005e] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.TimeZoneInfo.GetUtcOffset (System.DateTime dateTime, System.Boolean& isDST) [0x0005e] in <f712f98eb8e445c8918edaf595bbe465>:0
at System.TimeZoneInfo.GetUtcOffset (System.DateTime dateTime) [0x00000] in <f712f98eb8e445c8918edaf595bbe465>:0
at Test.Main () [0x00058] in <a931a161b7a644ec871f4bf6d9e99b8f>:0
I strongly suspect that Mono is trying to do what Noda Time was doing: see when the adjustment rule *would* have occurred in 1947 or 1949, at which point it will fail because February 29th didn't exist.