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.
Asked
Active
Viewed 3,102 times
1

Prestaul
- 83,552
- 10
- 84
- 84
-
What timeZoneIds will you be using? UTC time zones, US states, Country Names? – Russ Cam Apr 14 '09 at 13:54
2 Answers
2
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 How do I determine the system's Olson zoneinfo in JavaScript?