javascript JSON 格式的时区列表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32003692/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 14:43:36  来源:igfitidea点击:

List of Timezones in JSON format

javascriptjson

提问by yesterdaysfoe

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

我正在寻找与主要城市相对应的时区列表。就像java.util.TimeZone可以提供的那样。我的意思是,我想将America/Los_Angeles标识符解析为UTC-8:00javascript。

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

是否已经存在具有此功能的现有 JSON 文件或格式?

I came across to thiswhich 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)

解决方案:使用moment.js检测当前用户时区的ID (没有直接回答我的问题,但解决了我的问题)

回答by Osama Mohamed

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

我认为,这对你有好处 http://momentjs.com/timezone/