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
Add a ment  | 

1 Answer 1

Reset to default 7

Because 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.

本文标签: