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

date_time_this_year provides non existent date #2027

Open
jon-parise opened this issue Apr 15, 2024 · 2 comments
Open

date_time_this_year provides non existent date #2027

jon-parise opened this issue Apr 15, 2024 · 2 comments

Comments

@jon-parise
Copy link

  • Faker version: 24.4.0
  • OS: Mac, Linux (Ubuntu)

Usage of date_time_this_year can sometimes choose a date that does not exist. It throws an exception pytz.exceptions.NonExistentTimeError: 2024-03-10 02:11:40.454602

This is because this is the time when clocks changed for daylight savings. Clocks rolled back at 2AM, so no times in that hour exist.

Steps to reproduce

  1. Use date_time_this_year repeatedly, eventually it will pick a bad date.

Expected behavior

The library should not provide datetimes that do not exist.

Actual behavior

The library provided a datetime that does not exist

@esass10
Copy link

esass10 commented Apr 17, 2024

Hi, I am interested in taking this issue on. Can this be assigned to me?

@fcurella
Copy link
Collaborator

No need to formally assign the issue. Feel free to submit a Pull Request!

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

3 participants