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
ISO-8601 parsing doesn't work with named timezones #804
Comments
look at #162. Basically there is no reliable way to get time zone abbreviations. So there is no way we can parse them. I guess detecting them and passing them to the browser makes sense, but that won't work everywhere, for the same reason getting the zone abbr doesn't work. |
Hmm, it does look like a bug in the auto iso8601 parser. moment("2013-04-23 15:23:47 UTC"); // this is equivalent to the following
moment("2013-04-23 15:23:47 UTC", "YYYY-MM-DDTHH:mm:ss"); Because the parser is finding the This is something I'll definitely add tests against. Out of curiosity, where are you getting the input that contains the |
Thanks! Sorry, I've completely forgotten which of my datasets it was that had On Tue, May 28, 2013 at 05:46:02PM -0700, Tim Wood wrote:
|
The commit above solves this problem by not adding a 'T' in the format string if there is not one in the input string. I added your specific use case as a unit test as well. |
If I parse an ISO-8601 with a three letter timezone at the end, it comes out as invalid.
Curiously, if I call Date.parse then it works fine, which points to it being a bug in the extra browser-compatible ISO-8601 parser in moment.
The text was updated successfully, but these errors were encountered: