none
Why no enum for time zones? RRS feed

  • Question

  • I do not understand why Microsoft have not defined an enum for time zones?

    Instead we must create a TimeZoneInfo by passing a name string and that name must be defined in the machine's registry with the time zone details.

    But since there are a pretty well established set of time zones I do not understand why they did not define an enum or at least a static file with a number of constants in.

    https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations

    Does anyone know why they didn't do this? there should be no dependency on a machine's registry in order to create something this simple.

    Tuesday, April 11, 2017 9:51 PM

All replies

  • Much like the reason why there is no enum for country names.

    Regional time zone is subject to the policy of that government, especially for countries that have territories spread across longitude worth more than 1 hour.

    Say, for New Zealand, it has New Zealand Mean Time (NZMT) that is GMT+11:30, and there is also New Zealand Standard Time (NZST) that is GMT+12.

    Timezones are created and abandoned from time to time, each new country established has it's own right to create and set it's timezone, usually at 15 minutes precision towards GMT.


    Wednesday, April 12, 2017 1:23 AM
    Answerer