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

Missing hour during DST long day when shifting or calculating ranges #1162

Open
jblackmersolea opened this issue Sep 11, 2023 · 3 comments
Open
Labels

Comments

@jblackmersolea
Copy link

Issue Description

When iterating or shifting over times that cross the DST long day change, an hour is skipped when the time zone is set for something other than UTC.

The following demonstrates the issue where the first loop prints 2 hours for the span, but converting those same timestamps to UTC prints 3 hours (correctly). It's also strange that the tzinfo has to be set for the ISO timestamp containing the offset hours.

dts = arrow.get("2021-11-07T01:00:00-05:00", tzinfo="US/Central")
dte = arrow.get("2021-11-07T02:00:00-06:00", tzinfo="US/Central")
for dt in Arrow.range("hours", dts, dte):
    print(dt)
print("---BREAK---")
dts = arrow.get("2021-11-07T01:00:00-05:00", tzinfo="US/Central").to("UTC")
dte = arrow.get("2021-11-07T02:00:00-06:00", tzinfo="US/Central").to("UTC")
for dt in Arrow.range("hours", dts, dte):
    print(dt)

System Info

  • 🖥 Ubuntu 22.04.3 LTS
  • 🐍 Python 3.10.12
  • 🏹 Arrow 1.2.3
@ArcXeon
Copy link

ArcXeon commented Sep 26, 2023

Can I take this issue?

@SarthakNikhal
Copy link

Can I work on this issue? @jblackmersolea

@jblackmersolea
Copy link
Author

Anyone can work on this issue as far as I know.

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

No branches or pull requests

3 participants