Bug 3277 - System.TimeZoneInfo not returning US timezones
Summary: System.TimeZoneInfo not returning US timezones
Status: RESOLVED FEATURE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-02-08 14:35 UTC by Neal
Modified: 2012-02-08 17:41 UTC (History)
3 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 FEATURE

Description Neal 2012-02-08 14:35:53 UTC
Hello,

I updated to MT 5.2 stable today and I'm having a problem getting a list of timezones from System.TimeZoneInfo.  It worked fine yesterday in the prior stable.  You can see Miguel's code here:

http://stackoverflow.com/questions/8822291/how-to-create-an-ios-time-zone-picker

It's not showing the US time zones which are in the bottom of the list after Pacific.  There should be US/Eastern for example.  

Thank you.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-02-08 17:11:13 UTC
It looks like this is because of the fix for bug #1790 - now we actually query the available timezones properly. In my iPad 2 I don't have a US/Eastern timezone for instance.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2012-02-08 17:12:17 UTC
Sebastien, CC'ing you since this looks like it was caused your fix for bug #1790.
Comment 3 Sebastien Pouliot 2012-02-08 17:20:30 UTC
Neal, can you tell me if this occurs on the simulator, device or both ?
and what version of iOS you're using ?
thanks
Comment 4 Neal 2012-02-08 17:28:57 UTC
Hello Sebastian, I'm using the iPhone SIM, iOS 4 (iPod touch 4G) and iOS 5 (iPhone 4S).

This may very well be the correct behavior and what I was seeing previously could have been incorrect.  I now see America/New York which is what my phone shows for the time zone.

Thanks.
Comment 5 Sebastien Pouliot 2012-02-08 17:41:32 UTC
[Parts of] TimeZoneInfo did not work on devices (prior to MT 5.1, bug #1790) because it tried to initialize itself from files that cannot be accessed on the devices (but that the simulator has access). 

The new (5.2) stable release now initialize itself from NSTimeZone's own data. This has the advantage of ensuring data consistency between using .NET and iOS API (and making sure the .NET API works).

OTOH that means that the list can vary from one iOS version to another (just like it can between OSX, Linux or Windows releases). Sadly I did not spot the naming difference or I would have put it clearly in the release notes.