Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my web application , I filled a dropdownlist with Whole Timezones.
In page load of this page I am used following code to get whole timezone, TimeZoneInfo.GetSystemTimeZones()

It is filling correctly in a dropdownlist.
Now I want to set default value of this dropdown based when user open this page .
So need javascript method to implement this thing.

Am used some javascript methods but not getting proper result.

var locdate = new Date();

here locdate date has full value. ':Mon Mar 31 2014 15:27:23 GMT+0530 (India Standard Time)'

But in some timezone like 'E. Africa Standard Time', 'E. Europe Standard Time' not standard time value.
and also this in IE browser only getting datetime .
Posted
Updated 31-Mar-14 0:00am
v2

1 solution

 
Share this answer
 
Comments
vipinsethumadhavan 3-Apr-14 1:46am    
I tried these section.
But getting only timezoneoffset value like +5.30 .But this issue is more than one timezone have this same offset . So we can not get exact timezone by this code.
I got countryCode, countryname ,cityName,region name, zip ,latitude,longitude,offset value via another API. Have any way to get timezone (India Standard Time etc ) by these any values.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900