Skip to content
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

Timezone offset is reversed, Z and ZZ #851

Closed
ZeeStorm opened this issue Jun 17, 2013 · 3 comments
Closed

Timezone offset is reversed, Z and ZZ #851

ZeeStorm opened this issue Jun 17, 2013 · 3 comments

Comments

@ZeeStorm
Copy link

In the documentation (and examples), Z is "+####" and ZZ is "+ZZ:ZZ", however the actual implementation is reversed. It doesn't appear that it makes a difference when passing in a date with Z or ZZ to be read, however for .format() it does make a difference, since Z is outputting "+##:##" whereas ZZ is outputting "+####", contradicting the documentation.

@timrwood
Copy link
Member

Z and ZZ are treated the same as far as parsing is concerned.

They are correctly documented in the formatting token section as below.

Z    -07:00 -06:00 ... +06:00 +07:00
ZZ   -0700  -0600  ... +0600  +0700

@ZeeStorm
Copy link
Author

My apologizes, I saw this on the documentation page:

...
Z, ZZ Timezone offset as +0700 or +07:30 [read as Z = +0700 and ZZ = +07:30, due to the order on the page]
...
moment("2010-10-20 4:30 +0000", "YYYY-MM-DD HH:mm Z"); // parsed as 4:30 GMT

And didn't go to the tokens later that detailed them the way you described. Thank you for your time.

@timrwood
Copy link
Member

No problem, I filed an issue over on the documentation repo to switch it around so it is less confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants