Bug 60036 - Date.Time parse issue (year 1948)
Summary: Date.Time parse issue (year 1948)
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries (show other bugs)
Version: XI 10.3 (iOS 10.2)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-07 14:25 UTC by Alessandro Facchini
Modified: 2018-04-03 10:38 UTC (History)
7 users (show)

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


Attachments
TestApp (25.72 KB, application/zip)
2018-01-11 12:43 UTC, Manuel de la Peña [MSFT]
Details
Error screenshot (353.81 KB, image/png)
2018-01-11 13:09 UTC, Fabio Cozzolino [MVP]
Details


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 60036 on Developer Community or GitHub 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: Developer Community HTML or GitHub Markdown
  • 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:
Status:
CONFIRMED

Description Alessandro Facchini 2017-10-07 14:25:32 UTC
hi i've been experiencing this issue on both iOS and Android.

this line of code
	var d = DateTime.ParseExact("1948-02-19T08:00:00+02:00", "yyyy-MM-ddTHH:mm:sszzz", null); //KO

return an error: year, Month, and Day parameters describe an un-representable DateTime.

But this error it's returned only for the year 1948, for any other year it works correctly:
the below line infact, works fine
var d1 = DateTime.ParseExact("1949-02-19T08:00:00+02:00", "yyyy-MM-ddTHH:mm:sszzz", null); //OK


I've spent a lot of time to figure out that the problem was like this because i received the same error in my soap based web services. Once investigated i determined that the error was raised only for the year 1948

To reproduce the issue it's enough you run the line of code above

Regards

alessandro Facchini
Comment 1 Marek Safar 2017-10-09 13:55:01 UTC
What CultureInfo.CurrentCulture this is on ? I can reproduce it only with `ar-SA`
Comment 2 Alessandro Facchini 2017-10-09 14:28:08 UTC
Hi

my culture is "IT-it", but i've seen the same behaviour in "en-US".

my environment is the one specified below:

Xamarin Studio Community
Version 6.3 (build 864)
.net runtime Mono 4.8.0 (i tried also older ones and newer ones)

Xamarin.Android
Version: 7.4.0.21 (Xamarin Studio Community)

Xamarin.iOS
Version: 10.12.0.20 (Xamarin Studio Community)

Operating System
Mac OS X 10.12.6

As addition information it seems that in iOS the issue is either on the emulators or on the real devices, whereas on android the issue arises only on real devices

Please le me know for any further question

Best regards

alessandro facchini
Comment 3 Manuel de la Peña [MSFT] 2017-11-15 12:47:10 UTC
Hello,

I cannot reproduce the bug with the following env:

=== Visual Studio Community 2017 for Mac (Preview) ===

Version Preview - Internal Dogfood (7.3 build 764)
Installation UUID: 8d12e55e-3489-463f-ac52-8cb4573c5a81
Runtime:
	Mono 5.4.1.6 (2017-06/1f4613aa1ac) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010006

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.0.0
	1.1.2
	1.0.5
	1.0.0
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Versions:
	2.0.0
	1.0.4
	1.0.0-preview2-003121
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.6
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.1 (13532)
Build 9B55

=== Xamarin.iOS ===

Version: 11.3.0.47 (Visual Studio Community)
Hash: 51128b8c
Branch: xcode9.1
Build date: 2017-10-31 22:42:13-0400

=== Xamarin.Android ===

Version: 8.0.2.1 (Visual Studio Community)
Android SDK: /Users/mandel/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
		6.0   (API level 23)
		7.1   (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.1

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Version: 3.8.1.0 (Visual Studio Community)

=== Xamarin Inspector ===

Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 703000764
Git revision: 54e0a0247ce488f81f6c7806c9bae93307e66c2b
Build date: 2017-11-08 19:20:11-05
Xamarin addins: 97c21309aa29fd2e7df52a5d7426f39a693ea318
Build lane: monodevelop-lion-dogfood-vNext

=== Operating System ===

Mac OS X 10.13.1
Darwin 17.2.0 Darwin Kernel Version 17.2.0
    Fri Sep 29 18:27:05 PDT 2017
    root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Internet of Things (IoT) development (Preview) 7.1


Can you please update and test it. You have version 10.12.0.20 while I used the latests one Version: 11.3.0.47
Comment 4 Alessandro Facchini 2017-11-28 10:45:43 UTC
Hi

i tested with the last version (11.3.0.47) and the issuse doesn't raise anymore.

so it's OK now.

Thanks

best regards

alessandro facchini
Comment 5 cristian 2017-12-13 23:32:15 UTC
Hello,
I'have the same error, even using the latest bits and this line of code (tested on iOS)
DateTime.Parse("1948-02-19T23:00:00Z", CultureInfo.InvariantCulture);

My info:
=== Visual Studio Community 2017 for Mac ===

Version 7.3 (build 799)
Installation UUID: c4585c05-e51f-4383-a65d-07a7d39c926f
Runtime:
	Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010007

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.0
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Version: 2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.2 (13772)
Build 9C40b

=== Xamarin.iOS ===

Version: 11.6.1.2 (Visual Studio Community)
Hash: 6857dfcc
Branch: xcode9.2
Build date: 2017-12-04 21:20:41-0500

=== Xamarin.Android ===

Version: 8.1.0.24 (Visual Studio Community)
Android SDK: /Users/cristiancivera/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)

SDK Tools Version: 23.0.5
SDK Platform Tools Version: 21.0.0
SDK Build Tools Version: 21.1.1

Java SDK: /usr
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin Inspector ===

Not Installed

=== Build Information ===

Release ID: 703000799
Git revision: df590420ea5bc681994baefff2eabdaad889fba9
Build date: 2017-12-05 09:23:45-05
Xamarin addins: 51068d6eaf3b6fb4fbc72b33cb869b0ebff04ec5
Build lane: monodevelop-lion-d15-5

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Comment 6 Alessandro Facchini 2017-12-15 06:31:38 UTC
hello

i confirm the issue is still there in iOS only, latest environment


Sorry for having come to the wrong conclusion before; i had probably only tested in android where it works fine.

Regards

alessandro Facchini
Comment 7 Manuel de la Peña [MSFT] 2017-12-15 15:59:38 UTC
Can you please provide you android and your iOS versions you have as well as a small test case that prints the current culture info to ensure that we are in the same page.
Comment 8 Alessandro Facchini 2017-12-16 09:57:08 UTC
Hello

here is a summary of mu system:

1) the problem only arises with ioS
2) Visual Studio Community 2017 for Mac
Version 7.3 (build 799)
Installation UUID: 709e8040-2a02-4eaf-8a88-6ffade69edb2
Runtime:
	Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010007
3)Xamarin.iOS
Version: 11.6.1.2 (Visual Studio Community)
Hash: 6857dfcc
Branch: xcode9.2
Build date: 2017-12-04 21:20:41-0500
4) culture en-US
var d = DateTime.ParseExact ("1948-02-19T08:00:00+02:00", "yyyy-MM-ddTHH:mm:sszzz", null); //KO 
line of code that doesn't work

Let me know if you need further details

regards

alessandro facchini
Comment 9 Fabio Cozzolino [MVP] 2017-12-17 20:36:00 UTC
Hi,
I'm getting exactly the same error. The code fails only when the year is 1948 but in my case the culture is it-IT.
Comment 10 Alessandro Facchini 2017-12-17 21:15:32 UTC
Hello I can also confirm that besides the english culture the issue arises in it-IT as well

Best Regards

alessandro facchini
Comment 11 Fabio Cozzolino [MVP] 2018-01-03 12:10:24 UTC
Hi,
any updates? What kind of info do you need?

Thanks
Fabio
Comment 12 Manuel de la Peña [MSFT] 2018-01-08 09:48:27 UTC
Hello,

Sorry for the late reply (due to the holidays). The reason I'm asking about the android version which you used to test is because the code should be shared between iOS and Android, that is, I'd expect both to have the same behaviour since this is part of the bcl.

I'll retest with master and will provide info here.
Comment 13 Sebastien Pouliot 2018-01-08 22:59:11 UTC
All, but one*, case mentioned here all works fine with master/15.6
https://gist.github.com/spouliot/9b34f25c2517c61598f9bb703187162b

Either this was fixed by a mono update (but I doubt it since I had the same results with XI 11.6.1.2) or this requires some specific code/configuration to reproduce.

To verify the later please attach a self-contained test case to the bug report. A full stack trace of the reported exception would also be helpful. Those will remove most potential side effects that could prevent us from duplicating the issue.

Thanks!

* ar-SA complains about the calendar, which does not match the description.
Comment 14 Fabio Cozzolino [MVP] 2018-01-09 16:22:14 UTC
Hi Sebastien,
I've created a gist with my configuration, the stack trace, and a line of code that throw the reported exception:

https://gist.github.com/fabiocozzolino/3f9caa56403cad1e31183bbcbc9741a0

hope this helps
Comment 15 Manuel de la Peña [MSFT] 2018-01-11 12:43:18 UTC
Created attachment 26079 [details]
TestApp

I have tested the attached application (simple dummy app that prints the parsing) with the following environment and works as expected.

=== Visual Studio Community 2017 for Mac ===

Version Preview - Internal Dogfood (7.3.3 build 5)
Installation UUID: 8d12e55e-3489-463f-ac52-8cb4573c5a81
Runtime:
	Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010007

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.0.0
	1.1.2
	1.0.5
	1.0.0
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Versions:
	2.0.0
	1.0.4
	1.0.0-preview2-003121
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.2 (13772)
Build 9C40b

=== Xamarin.iOS ===

Version: 11.6.1.3 (Visual Studio Community)
Hash: f70a1348
Branch: xcode9.2
Build date: 2017-12-18 14:47:16-0500

=== Xamarin.Android ===

Version: 8.1.3.0 (Visual Studio Community)
Android SDK: /Users/mandel/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
		6.0   (API level 23)
		7.0   (API level 24)
		7.1   (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.1

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Version: 4.0.0.215 (Visual Studio Community)

=== Xamarin Inspector ===

Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 703030005
Git revision: b1c2982e201e71ef758866c9ade05f253a8c6f47
Build date: 2017-12-21 11:06:49-05
Xamarin addins: f397ddfbacfb39e60c9cc8d9e410f73faf8c2cbc
Build lane: monodevelop-lion-dogfood-vNext

=== Operating System ===

Mac OS X 10.13.1
Darwin 17.2.0 Darwin Kernel Version 17.2.0
    Fri Sep 29 18:27:05 PDT 2017
    root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

WakaTime 3.0.2
Internet of Things (IoT) development (Preview) 7.1



Note that the plist sets the development region to IT to make sure that the app uses the it-It culture info.

Could you please test with the latests stable the attached app and let me know if it works for you?
Comment 16 Fabio Cozzolino [MVP] 2018-01-11 13:09:19 UTC
Created attachment 26080 [details]
Error screenshot
Comment 17 Fabio Cozzolino [MVP] 2018-01-11 13:12:18 UTC
Hi Manuel,
tested before and after the last update, same problem, as you can see on the attachment.

Fabio
Comment 18 Fabio Cozzolino [MVP] 2018-01-11 13:56:42 UTC
Hi Manuel, 
the following stack trace, complete with parameters value, may be helpful:

System.DateTime.DateToTicks(int year = 1947, int month = 2, int day = 29) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/datetime.cs:523
System.DateTime..ctor(int year = 1947, int month = 2, int day = 29) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/datetime.cs:179
System.TimeZoneInfo.TransitionPoint(System.TimeZoneInfo.TransitionTime transition = {System.TimeZoneInfo.TransitionTime}, int year = 1947) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:1223
System.TimeZoneInfo.IsInDSTForYear(System.TimeZoneInfo.AdjustmentRule rule = {System.TimeZoneInfo.AdjustmentRule}, System.DateTime dateTime = {19/02/1948 23:00:00}, int year = 1947) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:916
System.TimeZoneInfo.IsInDST(System.TimeZoneInfo.AdjustmentRule rule = {System.TimeZoneInfo.AdjustmentRule}, System.DateTime dateTime = {19/02/1948 23:00:00}) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:911
System.TimeZoneInfo.GetUtcOffsetHelper(System.DateTime dateTime = {19/02/1948 23:00:00}, System.TimeZoneInfo tz = {Local}, bool isDST = false) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:815
System.TimeZoneInfo.GetUtcOffset(System.DateTime dateTime = {19/02/1948 23:00:00}, bool isDST = false) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:795
System.TimeZoneInfo.GetUtcOffset(System.DateTime dateTime = {19/02/1948 23:00:00}) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:763
System.TimeZoneInfo.ConvertTimeFromUtc(System.DateTime dateTime = {19/02/1948 23:00:00}) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:451
System.TimeZoneInfo.IsAmbiguousTime(System.DateTime dateTime = {19/02/1948 23:00:00}) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:884
System.TimeZoneInfo.GetUtcOffsetFromUtc(System.DateTime time = {19/02/1948 23:00:00}, System.TimeZoneInfo zone = {Local}, bool isDaylightSavings = false, bool isAmbiguousLocalDst = false) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/corlib/System/TimeZoneInfo.cs:1504
System.DateTimeParse.AdjustTimeZoneToLocal(System.DateTimeResult result = {System.DateTimeResult}, bool bTimeOnly = false) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs:2738
System.DateTimeParse.DetermineTimeZoneAdjustments(System.DateTimeResult result = {System.DateTimeResult}, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None, bool bTimeOnly = false) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs:2623
System.DateTimeParse.ParseISO8601(System.DateTimeRawInfo raw = {System.DateTimeRawInfo}, System.__DTString str = {System.__DTString}, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None, System.DateTimeResult result = {System.DateTimeResult}) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs:2839
System.DateTimeParse.TryParse(string s = "1948-02-19T23:00:00Z", System.Globalization.DateTimeFormatInfo dtfi = {System.Globalization.DateTimeFormatInfo}, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None, System.DateTimeResult result = {System.DateTimeResult}) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs:2420
System.DateTimeParse.Parse(string s = "1948-02-19T23:00:00Z", System.Globalization.DateTimeFormatInfo dtfi = {System.Globalization.DateTimeFormatInfo}, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/globalization/datetimeparse.cs:2278
System.DateTime.Parse(string s = "1948-02-19T23:00:00Z", System.Globalization.CultureInfo provider = {}) in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.3/src/mono/mcs/class/referencesource/mscorlib/system/datetime.cs:1032
TestDateParsin.ViewController.ViewDidLoad() in /Users/fimesan/Downloads/TestDateParsin/ViewController.cs:21
UIKit.UIApplication.UIApplicationMain() in 
UIKit.UIApplication.Main(string[] args = {string[0]}, System.IntPtr principal = 0x0, System.IntPtr delegate = 0x600000a3b640) in /Users/builder/data/lanes/5665/f70a1348/source/xamarin-macios/src/UIKit/UIApplication.cs:79
UIKit.UIApplication.Main(string[] args = {string[0]}, string principalClassName = (null), string delegateClassName = "AppDelegate") in /Users/builder/data/lanes/5665/f70a1348/source/xamarin-macios/src/UIKit/UIApplication.cs:63
TestDateParsin.Application.Main(string[] args = {string[0]}) in /Users/fimesan/Downloads/TestDateParsin/Main.cs:12
Comment 19 Fabio Cozzolino [MVP] 2018-01-11 15:42:56 UTC
Hi,
think I've found the problem. In TimeZoneInfo you have the following code:

private bool IsInDST (AdjustmentRule rule, DateTime dateTime)
{
	// Check whether we're in the dateTime year's DST period
	if (IsInDSTForYear (rule, dateTime, dateTime.Year))
		return true;

	// We might be in the dateTime previous year's DST period
	return dateTime.Year > 1 && IsInDSTForYear (rule, dateTime, dateTime.Year - 1);
}

Since the DST period in 1948 starts on February 29 and our test date is February 19, 1948, the IsInDSTForYear method is called. Then, the TransitionPoint method is called to get the datetime for compare reason:

bool IsInDSTForYear (AdjustmentRule rule, DateTime dateTime, int year)
{
	DateTime DST_start = TransitionPoint (rule.DaylightTransitionStart, year);

finally, in the TransitionPoint, a new datetime is created by using the transition time (29-02) and the year (1947):

private static DateTime TransitionPoint (TransitionTime transition, int year)
{
	if (transition.IsFixedDateRule)
		return new DateTime (year, transition.Month, transition.Day) + transition.TimeOfDay.TimeOfDay;

and baaam! Obviously, the 29 February 1947 doesn't exist!

Fabio
Comment 20 Manuel de la Peña [MSFT] 2018-01-15 11:48:57 UTC
@Fabio those are great news. But nevertheless we need to make sure that at least one of the developers that will fix the issue can reproduce it, otherwise we are taking a shot in the dark. Lets try to trace down your exact OS version to see if there is something that comes from the underlaying system that might be affecting the mono code.

Info we want to have:

* Exact OS version (Mac OS X ...)
* Exact OS Language settings. @Sebastien and I work with probably different settings regarding this that might be affecting the code paths used. I know I'm using en-UK and I would expect @Sebastien to use a different one.
* You time zone settings.

With the above, we can try to have a system with the same setup to see if we can reproduce it.
Comment 21 Fabio Cozzolino [MVP] 2018-01-15 21:11:44 UTC
@Manuel, sorry but at the moment I'm out of office. Try to change your Mac OS X timezone to European Standard Time / Rome and run your test project. You'll get the error.
Comment 22 Manuel de la Peña [MSFT] 2018-01-18 10:13:37 UTC
@Fabio I have modified my system to use the CET/Rome time zone and can reproduce the bug. This is an issue on the mono side so I'll reassign the bug accordingly.

Thanks a lot for the help.
Comment 23 Fabio Cozzolino [MVP] 2018-04-03 10:38:15 UTC
@Manuel, any news? How can I track the bug on mono side?

Thanks