Closed rzvdaniel closed 10 months ago
Hi, guys!
Do no bother anymore with thicket, closing it.
I missed the fact that the project is in maintenance mode, so no point in chasing you any longer :P.
Good luck! Razvan
moment.utc()
overrides the default to explicitly set the time zone as UTC. Calling just moment(dateString).format()
should use the zone from moment.tz.setDefault()
correctly.
Environment
{ date: "Thu Nov 02 2023 12:37:34 GMT+0100 (Central European Standard Time)", intlZone: "Europe/Madrid", moment: "2.18.1", momentTz: "0.5.43" }
No other frameworks are being used other than moment.js and moment-timezone.js.
Issue description
Setting the timezone using
moment.tz.setDefault("America/Los_Angeles")
does not have effect on the retrieved date later on.Doing the same using
moment.utc(date).tz("America/Los_Angeles")
works as expected.Here is a Fiddle that demonstrate it: https://jsfiddle.net/0sLyzvpb/7/
Is moment.tz.setDefault() having an issue?