-
-
Notifications
You must be signed in to change notification settings - Fork 682
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
incorrect date without leading zero in .get('2016-1-17') #292
Comments
Even more disturbingly:
!!! |
I'm startled that this basic parsing fails. |
According to the document, So I'm afraid this might be import arrow
arrow.parser.DateTimeParser().parse('2016-1-10', 'YYYY-M-D') Or another solution here is we add another method to |
Hi Philip, I see. That is not unreasonable. However, if Arrow is to strictly Personally, I like the idea of arrow being a bit more flexible. Ease of Matt
|
I'm with Matt, if the date string is invalid or ambiguous it ought to raise an exception. Thanks for your attention to this. |
I'm also with the idea of raising an exception. I think it is feasible. Btw, @bencharb I think you are still need to parse the non-standard string. I know Arrow is great which helps us solved the timezone headache and output beatiful human-readable strings, but it may be not the best choice suitable for your needs. AFAIK parsedatetime is good at parsing human-readable datetime strings. So you may want to try that instead. |
That works, thanks, @philliptzou. |
I'd like to reference issue #267 here as it points out a similar case of defaulting to 1 when parsing fails (instead of an exception). Example:
One would hope for an exception like dateutils.parser.parse gives:
Currently, my workaround is to not have |
Will be handled by #91 |
This is misleading. '2016-01-17' != '2016-1-17'
The text was updated successfully, but these errors were encountered: