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

Formatting as ISO8601 should use a Z when in UTC mode #3020

Closed
mj1856 opened this Issue Mar 8, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@mj1856
Member

mj1856 commented Mar 8, 2016

Currently, a moment in UTC mode (such as moment.utc(), or moment().utc(), etc.) is formatted with a +00:00 offset when .format() is called with no parameters.

Example:
image

For best conformance to ISO8601/RFC3339, when the time zone is explicitly UTC then we should use Z instead of +00:00.

The difference is semantic only, though important in some contexts. For example, +00:00 might be from London in the winter, or from several places in Africa. But Z is always UTC.

@theotow

This comment has been minimized.

theotow commented Mar 28, 2016

@mj1856 i would like to help, i have the enviroment up, can you give me another hint how to proceed, thanks

lcarva added a commit to lcarva/moment that referenced this issue Apr 8, 2016

Using Z suffix when in UTC mode (moment#3020)
As described in issue moment#3020, a moment in UTC mode
should be formatted, by default, with the letter Z
as a suffix instead of the time zone, +00:00.

lcarva added a commit to lcarva/moment that referenced this issue Apr 8, 2016

Using Z suffix when in UTC mode (moment#3020)
As described in issue moment#3020, a moment in UTC mode
should be formatted, by default, with the letter Z
as a suffix instead of the time zone, +00:00.
@maggiepint

This comment has been minimized.

Member

maggiepint commented Apr 8, 2016

Tracked by #3098

@maggiepint maggiepint closed this Apr 8, 2016

ichernev added a commit that referenced this issue Apr 16, 2016

Using Z suffix when in UTC mode (#3020)
As described in issue #3020, a moment in UTC mode
should be formatted, by default, with the letter Z
as a suffix instead of the time zone, +00:00.

ichernev added a commit that referenced this issue Apr 16, 2016

joelmukuthu pushed a commit to unexpectedjs/unexpected-moment that referenced this issue Jun 26, 2016

Joel Mukuthu
Update tests testing the default format for 'when formatted with'
Ref: moment/moment#3020
This presents a breaking change for anyone who might have been
asserting against the error message thrown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment