views:

47

answers:

1

Hi i have a typical requirement in my web application, i have to fill a dropdown box with all system timezones and set the selected time zone where from the client is browsing.

Only timezoneoffset is not enough to handle this suituation, since there are two reasons 1.the latest OS having more than one time zone with the same offset 2.If Day light save is enabled or disable(can be detected from Javascript) the offset will vary.

is ther any ways of handling this in Java script?

A: 

Check this: Auto detect a time zone with JavaScript.

MK
I read that article, and tried they were using each time zone offset with either DST enabled or disabled. if we refer the timezones from our OS, there are more time zone names with same offset for example(GMT +2:00) i have 9 entries.how to determine among them one is my query.
Dharma
It makes no difference to your report, because a time zone is a region on Earth, more or less bounded by lines of longitude, you have 9 entries that fall within the same line of longitude. what matters is daylight saving (that's why in the article you only find 2 entries for (GMT +2:00). Just combine the entries based on (SupportsDaylightSavingTime,BaseUtcOffset) so you have: (UTC+02:00 - DST:True) Amman,Athens, Bucharest, Istanbul, Beirut, Cairo,Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius,Jerusalem,Minsk,Windhoek. (UTC+02:00,DST:False) Harare, Pretoria
MK