Skip to content
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

%w | %W and %V | %u format string directives are not supported? #1242

Open
wikiped opened this issue Oct 30, 2024 · 0 comments
Open

%w | %W and %V | %u format string directives are not supported? #1242

wikiped opened this issue Oct 30, 2024 · 0 comments

Comments

@wikiped
Copy link

wikiped commented Oct 30, 2024

Assuming dateparser should support all format string directives supported by python, the following code demonstrates discrepancies in how its parsing results deviate from datetime's strptime:

import datetime as dt
import dateparser as dp

date = '01.24-1'
date_format = '%W.%y-%w'

date_iso = '01.2024-1'
date_format_iso = '%V.%G-%u'

print('Non-ISO date:')
print('Datetime: %s' % dt.datetime.strptime(date, date_format).date())
print('Dateparser: %s' % dp.parse(date, [date_format]).date())

print('ISO date:')
print('Datetime: %s' % dt.datetime.strptime(date_iso, date_format_iso).date())
print('Dateparser: %s' % dp.parse(date_iso, [date_format_iso]).date())

outputs:

Non-ISO date:
Datetime: 2024-01-01
Dateparser: 2024-10-30
ISO date:
Datetime: 2024-01-01
Dateparser: 2024-10-30
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