TzdbTimeZoneProvider
support conversion from Windows to Olson, but BclTimeZoneProvider
(provider for windows time zones) does not have correct implementation of MapTimeZoneId
method and interface seems wrong...
Here is implementation at TzdbTimeZoneProvider
:
public string MapTimeZoneId(TimeZoneInfo zone)
{
string str;
this.windowsIdMap.TryGetValue(zone.Id, out str);
return str;
}
Note: the windowsIdMap is a dictionary
Here is implementation at BclTimeZoneProvider
:
public string MapTimeZoneId(TimeZoneInfo timeZone)
{
return timeZone.Id;
}
Note: It just return id of windows time zone.
It seems more correct interface for this method will be:
string MapTimeZoneId(string providerZoneId);
Then both implementations can be done correctly. I guess you can put this question at Noda Time google groups.
For now you can look into TzdbTimeZoneProvider
to find way how to map from Olson to Windows tz (simple iteration through the windowsIdMap values).