Bug 60036 - Date.Time parse issue (year 1948)
Summary: Date.Time parse issue (year 1948)
Status: NEEDINFO
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: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-07 14:25 UTC by Alessandro Facchini
Modified: 2017-10-09 14:28 UTC (History)
2 users (show)

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


Attachments

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

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