-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
moment.local()
fails to clear the timezone
#738
Comments
Agreed that |
I'm working from memory at the moment (😄), but I believe that currently, const date = moment.tz('America/Los_Angeles');
date.tz() // => 'America/Los_Angeles'
date.local()
date.tz() // => 'America/Los_Angeles' The following is what I expected to happen: const date = moment.tz('America/Los_Angeles');
date.tz() // => 'America/Los_Angeles'
date.local()
date.tz() // => undefined Specifically, once set, there is no straightforward way of clearing a moment's timezone info and resetting it to the local timezone. I also tried |
Agreed. Also, the same is true when setting the offset explicitly with Will fix shortly. |
Thanks!!! |
Similar to issue #86, a call to
momentDate.local()
fails to clear the timezone associated withmomentDate.tz()
.At the, ahem, moment, the only (supported) way I've found to clear the timezone is to use both
momentdate.utc()
andmomentDate.local()
. The first call clears the timezone and the second sets the moment to local time. I.e.momentDate.utc().local()
The text was updated successfully, but these errors were encountered: