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

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

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

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