-
Notifications
You must be signed in to change notification settings - Fork 7k
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
parseZone without timezone returning unexpected result #3083
Comments
(Also |
Calling this a bug. Moment is getting pretty confused by there not actually being a zone there. |
Does anyone have a preference for expected behavior? I looked at this one and I honestly wasn't sure what I thought it should do. |
Yeah, me neither. I'm tempted to back |
My bad. The offsetToString function return 0 if it fails to find a zone. So this needs to be addressed first, and then in case there is no zone just do |
If you provide a timestamp with no timezone offset to
parseZone
it seems to parse it in your browser's timezone, but then sets the_offset
to 0 and_isUTC
to true. This seems unexpected.I would expect either
2016-02-01T00:00:00+00:00
or2016-01-31T16:00:00-08:00
(assuming my browser's offset is -08:00). I thinkmoment.utc(s).utcOffset(s)
basically provides the former.The text was updated successfully, but these errors were encountered: