I want to use TimeZoneInfo, as I understood the TimeZoneInfo object take its in开发者_JS百科formation from the registry - but I dont understand why this object doesnot expose an enum or something else that contains all the TimeZone IDs - is it because the IDs are diffrent between duffrent windows? and if so the single way that I can get something time zone - first I should get all TimeZone's IDs by invoke GetSystemTimeZones() and then find the time zone that I want?
Thanks,
Timezones change - as indeed do the rules for each (DST etc).
Enums do not.
For the same reason, culture-info has a string identifier, not an enum. This also allows you to define your own cultures at runtime, and pick up changes as the OS gets updates from external sources. I actually hope you can do the same with timezones (define your own).
精彩评论