I'm looking for a way to map a BCL Time Zone value to a Tzdb Time Zone value to get the more expressive values exposed by Tzdb:
For example, I can get BCL time zone as follows. The incomingValue
variable is a Microsoft Windows name for the zone, for example Pacific Standard Time
from https://support.microsoft.com/en-ca/help/973627/microsoft-time-zone-index-values :
var bclZone = DateTimeZoneProviders.Bcl.GetZoneOrNull(incomingValue); // ok - it works
Next, what is the best way to then get an equivalent Tzdb zone value (or zones)? I've been fiddling with the following code to no avail.
// The Tzdb provider won't accept a BCL zone value or a Microsoft zone name.
DateTimeZoneProviders.Tzdb.GetZoneOrNull(.. ? ..);
The reason I'm asking for this conversion is because the Tzdb zone is more expressive containing abbreviations that can be employed in a tight display scenario, whereas I cannot find abbreviations or other rich values associated with the Microsoft BCL zone type. I'd rather use the Tzdb values than do a manual mapping because I think between these two zone providers they contain everything I need 'out of the box'.
I'm also mulling over using a UTC -/+ calculation to transition to the Tzdb value but am asking here if there is a better approach with noda.