2

I'm looking for a list of time zones that corresponds to major cities. Like what java.util.TimeZone can provide. I mean, I want to resolve the America/Los_Angeles identifier to UTC-8:00 in javascript.

Is there already an existing JSON file or format that has this feature?

I came across to this which is close to what I'm looking.


UPDATE

Solution: Detect the ID of the current user timezone using moment.js (Did not answer my question directly but solved my problem)

Community
  • 1
  • 1
yesterdaysfoe
  • 768
  • 3
  • 7
  • 23
  • 3
    Take database that fits your requirements and generate JSON from it. – zerkms Aug 14 '15 at 06:35
  • I think this one does not need database since it is a fix or less chance to change in the future. I asked because I'm hoping that someone has already a known approach to it. – yesterdaysfoe Aug 14 '15 at 06:40
  • Any idea of doing the reverse. Given the offset, it returns the abbreviated form of the timezone. – Dhiraj Gandhi Jan 11 '19 at 12:37
  • You could convert the array in this [answer](https://stackoverflow.com/a/54500197/217867) to JSON quite easily. – Lonnie Best Feb 03 '19 at 05:47

1 Answers1

5

I think, this will be benefit for you http://momentjs.com/timezone/

Osama Mohamed
  • 647
  • 1
  • 6
  • 10
  • yup, I had also came across to this but I think this will not solve my question, It simply get the identifier of settled timezone identifier. Anyways, can you provide example of how to use it? – yesterdaysfoe Aug 14 '15 at 06:50
  • Lot's of sample code in the docs http://momentjs.com/timezone/docs/#/using-timezones/ – Jon G Stødle Aug 14 '15 at 06:51
  • @JonStødle thanks! [Zone Object](http://momentjs.com/timezone/docs/#/zone-object/) is quite close but as I mention **It simply get the identifier of settled timezone identifier.** – yesterdaysfoe Aug 14 '15 at 07:03
  • Solved my problem. Thanks for the leads. [Detect the ID of the current user timezone using moment.js](http://stackoverflow.com/questions/19420582/detect-the-id-of-the-current-user-timezone-using-moment-js) – yesterdaysfoe Aug 14 '15 at 09:40