views:

475

answers:

2

Hi All!

Is there any way to get the current time for a particular timezone (ex: var currentTime=getCurrentTime(timezoneId) where timezoneId="alaska" or Eastern Time), including Day Light Saving in javascript.

+1  A: 

This looks like a solution, although it uses city names as references.

unwind
It also requires you to know the GMT offset of each timezone.
Prestaul
+1  A: 

Timezone handling isn't built into JavaScript, so you'd need a library containing all the timezone details (usually generated from the Olson database). eg. fleegix.date has one.

See also http://stackoverflow.com/questions/608423/how-do-i-determine-the-systems-olson-zoneinfo-in-javascript

bobince