You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect both lines producing the same result, but my actual local time zone is used instead of the default time zone. Output below:
moment.parseZone("2015-12-31T18:00:00.000-06:00")moment("2016-01-01T01:00:00.000")// wrong time zone
The only workaroud for converting UTC to the default timezone, I've found, is to use moment.utc('2016-01-01T00:00:00.000Z').tz(moment().tz()), but that looks clumsy.
The text was updated successfully, but these errors were encountered:
Note that you can create a moment in local mode from UTC-based input (having the Z), which will have the same effect. moment('2016-01-01T00:00:00.000Z')
But yes, it's a bug. Or rather, something we need to consider about what "local" means with respect to changing the default time zone.
Consider this code:
I would expect both lines producing the same result, but my actual local time zone is used instead of the default time zone. Output below:
The only workaroud for converting UTC to the default timezone, I've found, is to use
moment.utc('2016-01-01T00:00:00.000Z').tz(moment().tz())
, but that looks clumsy.The text was updated successfully, but these errors were encountered: