Question

I need to let user choose a time zone from a menu in my asp.net web application. The menu currently contains 102 zones based on the list returned by TimeZoneInfo.GetSystemTimeZones(). As you know, this list is not as complete as the IANA time zones list (or tz database).

I know noda time supports IANA/tz database. Unfortunately, I cannot apply noda time to my solution due to scope limit.

Question: Should I change the menu to have IANA time zones, then map those to the 102 Windows time zones?

Right now I'm leaning towards NO. The problem I see is that implementing this mapping hides the fact that my app doesn't actually support IANA time zones. Windows time zones are more general, so DST rules are not as accurate as IANA. Just wanted to get a second opinion on this. Thanks.

Was it helpful?

Solution

If your application implements .Net TimeZoneInfo, then you should probably just show Windows time zones via the DisplayName property of the TimeZoneInfo object, then store the corresponding Id property as the users's time zone selection.

On the other hand, if you were to expose a map-based time zone selection picker, such as this one or this one, then you could use their resulting IANA time zone ID to map to a Windows zone. But if you have no such need to this kind of UI, then don't bother with them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top