Skip to content

HH token does not support the number 24, even though the documentation says it should (00 to 24) #703

@ceorcham

Description

@ceorcham

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 exception ValueError: 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 24

if 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions