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

Pendulum 3.0.0 unable to parse specific date / weeknumber #839

Open
2 tasks done
jakobdo opened this issue Aug 27, 2024 · 1 comment
Open
2 tasks done

Pendulum 3.0.0 unable to parse specific date / weeknumber #839

jakobdo opened this issue Aug 27, 2024 · 1 comment

Comments

@jakobdo
Copy link

jakobdo commented Aug 27, 2024

  • I am on the latest Pendulum version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • Windows 11 - 23H2

  • 3.0.0

Hello,
when trying to parse the following date / weeknumber: "2024W401" I noticed updating from 2.1.2 to 3.0.0 my code started to fail.

Pendulum 2.1.2
pendulum.parse("2024W401", tz="CET")
DateTime(2024, 9, 30, 0, 0, 0, tzinfo=Timezone('CET'))

Pendulum 3.0.0
pendulum.parse("2024W401", tz="CET")
pendulum.parsing.exceptions.ParserError: Unable to parse string [2024W401]

The following "strings" works ok:
pendulum.parse("2024W400", tz="CET")
DateTime(2024, 9, 29, 0, 0, 0, tzinfo=Timezone('CET'))
pendulum.parse("2024W402", tz="CET")
DateTime(2024, 10, 1, 0, 0, 0, tzinfo=Timezone('CET'))

@Stoney256
Copy link

Stoney256 commented Oct 7, 2024

Bug seems to be introduced in 3.0.0b1, 3.0.0a1 works fine

print(pendulum.parse('2024W40', tz='Europe/Amsterdam').format('DD-MM-YYYY HH:mm:ss'))

Gives: 30-09-2024 00:00:00

Edit: add code and result example

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

2 participants