0

A client's Android app is reporting a TimeZoneNotFoundException for the following code/value (written in Xamarin):

TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");

How can this be? Are some Android devices missing some time zones? It works fine on our test devices and I have been unable to find anything on the internet.

Le-roy Staines
  • 2,037
  • 2
  • 22
  • 40

1 Answers1

0

You must use Olson IDs.

http://www.mobtowers.com/xamarin-date-and-time-handling/ http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html

Or if you need to do it on the fly:

.NET TimeZoneInfo from Olson time zone

Community
  • 1
  • 1
Thyme Cypher
  • 73
  • 1
  • 9
  • Sorry, I misread some of this info - it seems you are using an Olson ID. Is this with MonoTouch? I did find something about there being a bug with MonoTouch but that also said it was for iOS I believe. – Thyme Cypher Dec 10 '14 at 21:16
  • `America/Los_Angeles` is definitely an Olson ID – njzk2 Dec 10 '14 at 21:20
  • 1
    Actually, I think the first link from @ThymeCypher may have the answer for your problem. It is located at the bottom of the article and it seems to be resolved by upgrading to Xamarin v4.8.2. – phxhawke Dec 10 '14 at 22:56