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

Parsing gives incorrect data instead of failing for unknown format #456

Closed
boxed opened this issue Sep 15, 2017 · 2 comments · Fixed by #655
Closed

Parsing gives incorrect data instead of failing for unknown format #456

boxed opened this issue Sep 15, 2017 · 2 comments · Fixed by #655
Labels

Comments

@boxed
Copy link

boxed commented Sep 15, 2017

Parsing '2001W05' (ISO8601 for the fifth week of 2001) with arrow gives you back 2001-05-01 which is totally wrong. Expected behavior is to either parse it correctly or throw an error when it find an unsupported format.

(Followup to #291)

@SUNx2YCH
Copy link

SUNx2YCH commented Oct 5, 2017

I want to add a couple of examples. They're not ISO8601 related, but perfectly match the issue title.

>>> arrow.get('31.12.2017')
<Arrow [2017-01-01T00:00:00+00:00]>
>>> arrow.get('12/31/2017')
<Arrow [2017-01-01T00:00:00+00:00]>

I would prefer an error in such cases, like in the following case:

>>> arrow.get('31 Dec 2017')
...
arrow.parser.ParserError: Could not match input to any of [u'YYYY-MM-DD HH:mm'] on '31 Dec 2017'

@msultani
Copy link

msultani commented Apr 2, 2018

Hi, I'm interested in taking a crack at this issue. Has it been addressed yet?

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