javascript - How can I get Current Local Time in California, United States using Moment.js? -


i searched doing can time zone of country

var la = moment.tz("america/los_angeles").format('yyyy-mm-dd hh:mm:ssz'); 

but when california no time zone available ?

running fiddle running example

solution :america/tijuana  have same timezone america/california 

because california not valid iana time zone identifier.

also the moment-timezone docs:

the moment.tz constructor takes same arguments moment constructor, uses last argument time zone identifier.

what do? use america/los_angeles, or other identifier in same time zone need.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -