Skip to content

Interpreting time #1264

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

Open
mrpanda opened this issue Apr 5, 2025 · 0 comments
Open

Interpreting time #1264

mrpanda opened this issue Apr 5, 2025 · 0 comments

Comments

@mrpanda
Copy link

mrpanda commented Apr 5, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant