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

Handle iso format where Z is prefixed with spaces #1294

Merged
merged 1 commit into from
Nov 22, 2013

Conversation

ichernev
Copy link
Contributor

In response to #1290

@Xotic750
Copy link
Contributor

As far as I am aware, a space before a 'Z' is not a valid iso 8601 format. While it may be worth being able to pass such an invalid stamp. shouldn't moment mark this as inValid aswell?

UTC[edit]
If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "0930Z". "14:45:15 UTC" would be "14:45:15Z" or "144515Z".
UTC time is also known as 'Zulu' time, since 'Zulu' is the NATO phonetic alphabet word for 'Z'.

@icambron
Copy link
Member

I think it probably isn't valid ISO-8601, but it used to work and it's advertised to work. If we remove it, we should remove it in 3.0.

Re: invalid: we've defined val to mean "moment understands what the date is", so if we can parse it into an actual real date, it's valid.

icambron added a commit that referenced this pull request Nov 22, 2013
Handle iso format where Z is prefixed with spaces
@icambron icambron merged commit a22ed50 into moment:develop Nov 22, 2013
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

Successfully merging this pull request may close these issues.

None yet

3 participants