Question

So I am currently in the "America/Los_Angeles" timezone (PDT), but when I create a new moment object and pass it through moment tz to set its timezone to the very one I'm in ('America/Los_Angeles'), like so:

moment().tz("America/Los_Angeles");

the wrong time is being returned. Specifically, it's 8 hours ahead. This happens for all other timezones I try as well.

Am I just fundamentally misunderstanding how this is supposed to work?

Thanks for any help!

Was it helpful?

Solution

When I replaced your copy of moment-timezone.js with the one from the web site, it returned the correct result.

OTHER TIPS

You need to use "zone" you pass it an offset off GMT.

moment().zone(-8)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top