Bug 7966 - imeZoneInfo.FindSystemTimeZoneById returns null
Summary: imeZoneInfo.FindSystemTimeZoneById returns null
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2012-10-24 09:06 UTC by Allie Miller
Modified: 2012-12-05 10:36 UTC (History)
2 users (show)

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


Description Allie Miller 2012-10-24 09:06:06 UTC
Case #18901

In MonoDroid 3.0.4, TimeZoneInfo.FindSystemTimeZoneById returns null instead of throwing a TimeZoneNotFoundException as specified in the MS .NET System.TimeZoneInfo documentation.

For example, 
TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
returns null under MonoDroid.

Seems specific to Mono for Android,since the Mono console app produces the "correct" result with the same code.

The bug has been identified in mcs/class/System.Core/System/TImeZoneInfo.Android.cs!GetTimeZone(string).
Comment 2 dean.ellis 2012-11-19 17:16:20 UTC
If we cannot find the requested time zone we should throw a
TimeZoneNotFoundException rather than returning null.

1: Fixed in master/a56f69f82d   

2) Fixed in mono-2-10/ddaa82c2b7 

3) Fixed in mobile-master/15150dcd41
Comment 3 dean.ellis 2012-12-05 10:36:28 UTC
The first fix had an error in the compare statement

1:  Fixed in master/956841a964 
2:  Fixed in mono-2-10/c310d28fa3
3:  Fixed in mobile-master/e2c99b7545

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