0

I have upgraded from Pendulum 1.4.4 to 2.1.2. After executing the following code, I'm getting different UTC offset from the same datetime. Note: Python version is 3.7 in both case.

Pendulum 1

import pendulum
base = pendulum.datetime(2020, 10, 25, 1, 0, 0)
local_tz = pendulum.timezone("Europe/Berlin")
print(local_tz.utcoffset(base))
1:00:00

Pendulum 2

import pendulum
base = pendulum.datetime(2020, 10, 25, 1, 0, 0)
local_tz = pendulum.timezone("Europe/Berlin")
print(local_tz.utcoffset(base))
2:00:00
Shaurya
  • 1
  • 1
  • "Europe/Berlin" had a DST change on Oct 25 2020, 3 am was followed by 2 am to change from UTC+2 to UTC+1. "Pendulum 1" is therefore wrong since at 1 am, Summer Time was still active (UTC+2). If the time was 2 am in your example, it would be ambiguous since that could have been UTC+2 *or* UTC+1. – FObersteiner Sep 24 '22 at 11:11

0 Answers0