Matt Johnson-Pint

Results 429 comments of Matt Johnson-Pint
trafficstars

There's nothing built in, but you could filter the list with a regex, like so: ``` javascript moment.tz.names().filter(function(s){ return /\//.test(s); }) ``` That just filters to those that contain a...

As a temporary workaround, the following will at least provide a list of canonical zones. ``` javascript var names = Object.keys(moment.tz._zones) .map(function(k) { return moment.tz._zones[k].split('|')[0]; }) .filter(function(z) { return z.indexOf('/')...

One note - TZDB frowns on actually using the time zone name for display to the end user. They recommend going through `zone.tab` or `zone1970.tab` with the descriptions. In practice...

The workaround for now is to pass the timestamp as a number instead of a string. ```js moment.unix(1461906597) // seconds moment(1461906597123) // milliseconds ``` If you have a string, then...

It's a better form to use anyway, and yes - it will work with the default time zone. The bug is only that the default timezone isn't working with `x`...

I believe this will be addressed if moment/moment-rfcs#1 is adopted.

Updated the original description. This can all go into moment-timezone, and should use the functions we created as part of the `.guess()` function when working with an regular `moment` object...

@petrgazarov - Yes, it's still needed. The example in the S.O. thread was: ``` js moment().tz('Europe/Paris').getNextDST(); ``` I'm not sure that's the exact API that we'd want, but something like...

Thanks for reporting. Please supply output of: ```js console.log(moment.version); console.log(moment.tz.version); console.log(navigator.userAgent); ``` Also please let us know what your operating system time zone is set to. Thanks.

Yes, I can confirm this is a bug. It returns incorrectly in all browsers when the time zone is set to UTC on Windows. Note that if you're actually in...