Skip to content

Interpreting time #1264

Open
Open
@mrpanda

Description

@mrpanda

HI, thanks for date parser. I am experimenting with collecting freehand dates and times entered into resource tags. I have tried the following:

print(dateparser.parse('6/4/25 7', settings={'DATE_ORDER': 'DMY', 'PREFER_DAY_OF_MONTH': 'first', "PREFER_MONTH_OF_YEAR": "current"}))

None. --> was hoping for 6-Apr-2025 07:00:00

print(dateparser.parse('Monday', settings={'DATE_ORDER': 'DMY', 'PREFER_DAY_OF_MONTH': 'first', "PREFER_MONTH_OF_YEAR": "current"}))

2025-12-31 00:00:00 --> was hoping for 7-Apr-2025 00:00:00

print(dateparser.parse('6/4/25 0730', settings={'DATE_ORDER': 'DMY', 'PREFER_DAY_OF_MONTH': 'first', "PREFER_MONTH_OF_YEAR": "current"}))

0730-04-06 00:00:00
Something not right here, it has used the time component for the Year even though the '/25' and date order was specified. Anyway, thanks for the library, I think it is very useful.

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