TzdbTimeZoneProvider supports conversion from Windows to Olson, but BclTimeZoneProvider (a provider for Windows time zones) does not have the correct MapTimeZoneId method MapTimeZoneId and the interface seems to be wrong ...
Here is the implementation on TzdbTimeZoneProvider :
public string MapTimeZoneId(TimeZoneInfo zone) { string str; this.windowsIdMap.TryGetValue(zone.Id, out str); return str; }
Note: windowsIdMap is a dictionary
Here is the implementation on BclTimeZoneProvider :
public string MapTimeZoneId(TimeZoneInfo timeZone) { return timeZone.Id; }
Note. It simply returns the identifier of the Windows temporary window.
It seems that a more proper interface for this method would be:
string MapTimeZoneId(string providerZoneId);
Then both implementations can be performed correctly. I think you can ask this question in Google Noda Time groups.
Now you can look at TzdbTimeZoneProvider to find a way to map from Olson to Windows tz (a simple iteration through windowsIdMap values).
source share