c# - TimeZoneInfo.GetSystemTimeZones() how to Select entries for specific country codes only? -


timezoneinfo.getsystemtimezones() gives enumeration of time zones. question how select entries specific country codes only. know utc offset , country code , need able select correct time zone value.

first, have discovered can't use utc offset due daylight savings variations (among perhaps other regional deviations). perhaps if provided utc offset current offset, , regularly polling it, use this?

regardless, don't think country code + utc going easy these reasons (which no doubt know):

  1. timezones have many-to-many relationship countries

    while "tokyo standard time" japan (or @ least, "jp" , utc+9:00 concievably give tokyo standard time), "central asia standard time"? sure, if had map of every country every timezone might able somewhere here.

  2. the same utc offset in same country can yield different timezones

    for instance, in australia, queensland (brisbane) not observe daylight savings time, whereas other eastern states do. yields "e. australia standard time" , "aus eastern standard time" seperate timezones same country , utc offset.

  3. there regional differences beyond utc

    these not concern due low relevance (and i'm not sure how precise usecase is), there anomalies such towns on borders of multiple timezones compromise "averaged utc" or similar. example of "central western standard time" (http://basementgeographer.blogspot.com/2010/07/central-western-standard-time-time-zone.html).

however, may find existing question (country timezone mapping database) of interest, yields link (http://www.twinsun.com/tz/tz-link.htm). assuming have enough provided information may able resolve timezone using data, or @ least best guess (or query user possible options?) if still useful/possible.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -