-
Notifications
You must be signed in to change notification settings - Fork 343
Closed
Labels
Milestone
Description
What situation does this request make simpler?
Since Noda Time contains IANA, Windows, and CLDR data, it can be used to
convert BCL time zones to or from TZDB time zones. The data is exposed in the
API, but sensible conversion methods aren't included. This could be more
convenient, such as illustrated here:
http://stackoverflow.com/a/17348822/634824
Can you provide a straw-man example of what you'd want the API to look
like?
string bclZoneId =
TzdbDateTimeZoneSource.Default.WindowsMapping.TranslateToBcl(tzdbZoneId);
string tzdbZoneId =
TzdbDateTimeZoneSource.Default.WindowsMapping.TranslateToTzdb(bclZoneId);
We could also consider (in addition) a new method to DateTimeZone with the
signature:
public DateTimeZone TranslateFor(IDateTimeZoneProvider provider)
Which would give some convenience for those not used to calling into a the
TzdbDateTimeSource, for example:
DateTimeZone bclZone =
DateTimeZoneProviders.Tzdb[tzdbZoneId].TranslateFor(DateTimeZoneProviders.Bcl);
DateTimeZone tzdbZone =
DateTimeZoneProviders.Bcl[bclZoneId].TranslateFor(DateTimeZoneProviders.Tzdb);
Original issue reported on code.google.com by mj1856 on 26 Mar 2014 at 6:08
cleftheris and jmoralesv