Skip to content

Formats like "1h20m" should be treated as relative but are actually absolute #1012

@abrahammurciano

Description

@abrahammurciano

When parsing a string like "1h20m", it should be treated as a relative date; i.e. the same as it would treat the string "1 hour and 20 minutes". However this is not the actual behaviour.

>>> from datetime import datetime
>>> from dateparser import parse
>>> datetime.now()
datetime.datetime(2021, 10, 28, 18, 17, 11, 563442)
>>> parse("1h20m")
datetime.datetime(2021, 10, 28, 1, 20)
>>> parse("in 1h20m")
datetime.datetime(2021, 10, 28, 1, 20)
>>> parse("in 1 hour and 20 minutes")
datetime.datetime(2021, 10, 28, 19, 37, 34, 355178)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions