Skip to content

PCL DateTimeZoneProviders.Tzdb.GetSystemDefault throws DateTimeZoneNotFoundException on non-English locale #221

@GoogleCodeExporter

Description

@GoogleCodeExporter
DateTimeZoneProviders.Tzdb.GetSystemDefault on PCL build throws 
DateTimeZoneNotFoundException when the display language (this is as tested on 
WP8) is set to non-English. 

Digging into the source, I found that on PCL, the library uses 
TimeZoneInfo.StandardName instead of normally TimeZoneInfo.Id for looking up 
the mapping. This apparently, is a localised name 
(http://msdn.microsoft.com/en-GB/library/system.timezoneinfo.standardname(v=vs.9
5).aspx) so this would not work properly. Eg. "Westeuropäische Zeit" instead 
of "GMT Standard Time". 

From my testing, I do find that the m_id private field of TimeZoneInfo is 
correctly set (at least on WP8), and in this case: "GMT Standard Time. However 
there may be a security restriction to access this field reflectively!

This is on version 1.1.0 from NuGet. And it is the PCL and as tested on WP8.

Original issue reported on code.google.com by wiyono.a...@gmail.com on 21 May 2013 at 12:56

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions