I need to make a <select> list of all actual world timezones. How do I get an array with timezones list?
var tz = moment. tz. guess(); It will return an IANA time zone identifier, such as America/Los_Angeles for the US Pacific time zone.
The main moment. js library has full functionality for working with UTC and the local time zone.
Moment construction falls back to js Date. This is discouraged and will be removed in an upcoming major release. This deprecation warning is thrown when no known format is found for a date passed into the string constructor.
Moment-Timezone is an add-on for Moment. js. Both are considered legacy projects, now in maintenance mode. In most cases, you should choose a different library. For more details and recommendations, please see Project Status in the Moment docs.
First include moment-timezone
with data and then you can use moment.tz.names();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With