-
-
Notifications
You must be signed in to change notification settings - Fork 689
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
HH token does not support the number 24, even though the documentation says it should (00 to 24) #703
Comments
Hey @ceorcham, you seem to be correct. On the Wikipedia page it says:
If you'd like to take this on, go for it! We should ensure that the new functionality works for both the parser and the formatter. |
@jadchaar I just made a PR (#705) with the changes for the parser, now 24:00 will become 00:00 next day. Don't hesitate requesting any changes if needed, I'm happy to help. I think changes for the formatter are not needed because the 24:00 is just another way to represent next day 00:00, so when formatting |
Ah yes you are correct! Thanks for the PR by the way--I am reviewing it right now. |
According to ISO 8601
arrow.get('2019-10-29T24:00:00')
should parse to October 30, 2019 (2019-10-30T00:00:00
), but instead is throwing an exceptionValueError: hour must be in 0..23
It also fails when doing explicit formatting (same exception)
arrow.get('2013-12-31T24:00:00', ['YYYY-MM-DD[T]HH:mm:ss'])
If you look at the docs at https://arrow.readthedocs.io/en/latest/#supported-tokens it says
HH
token is from 00 to 24if this is accepted as a bug, it seems a fix for this can be done at
arrow/parser.py
inside the_build_datetime
function ( I can do it, including unit tests)The text was updated successfully, but these errors were encountered: