My understanding of shift method was it will take care of DST. However when testing for 10 hours shift on 2025-03-08T18:30:00
with US/Central
as tzinfo, the expected output should be 2025-03-09T05:30:00-05:00
but I am getting 2025-03-09T04:30:00-05:00
. Fyi, DST changes on March 9, 2025. At 2 a.m
# Step 1: Create a timezone-aware datetime using Arrow
start = arrow.get("2025-03-08T18:30:00").format('YYYY-MM-DDTHH:mm:ss') # starting datetime
start_tz = arrow.get(start).replace(tzinfo='US/Central') # Set the timezone to US/Central
# Step 2: Shift by 10 hours
shifted = start_tz.shift(hours=10)
# Step 3: Print the result
print(shifted) # Should print: 2025-03-09T05:30:00-05:00 (after DST transition) but getting <Arrow [2025-03-09T04:30:00-05:00]>