admin管理员组文章数量:1391947
I searched that by doing like this I can get time zone of any country
var la = moment.tz("America/Los_Angeles").format('YYYY-MM-DD HH:mm:ssZ');
but when I do for California
it say no time zone available ?
running fiddle running example
SOLUTION :America/Tijuana have same timezone as America/California
I searched that by doing like this I can get time zone of any country
var la = moment.tz("America/Los_Angeles").format('YYYY-MM-DD HH:mm:ssZ');
but when I do for California
it say no time zone available ?
running fiddle running example
SOLUTION :America/Tijuana have same timezone as America/California
Share
Improve this question
edited Jul 26, 2017 at 5:26
ephemeral
asked Jul 25, 2017 at 16:47
ephemeralephemeral
4472 gold badges7 silver badges18 bronze badges
1
- momentjs./timezone/docs/#/data-loading/loading-a-data-bundle – user7605325 Commented Jul 25, 2017 at 16:54
1 Answer
Reset to default 7Because California
is not a valid IANA time zone identifier.
Also from the moment-timezone docs:
The
moment.tz
constructor takes all the same arguments as the moment constructor, but uses the last argument as a time zone identifier.
What do you do? Use America/Los_Angeles
, or any other identifier that is in the same time zone you need.
本文标签:
版权声明:本文标题:javascript - How can I get Current Local Time in California, United States using Moment.js? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744723673a2621845.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论