1

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.

Prestaul
  • 83,552
  • 10
  • 84
  • 84

2 Answers2

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?

Community
  • 1
  • 1
bobince
  • 528,062
  • 107
  • 651
  • 834
1

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

Community
  • 1
  • 1
unwind
  • 391,730
  • 64
  • 469
  • 606