I am experiencing differences in the way time zone definitions are applied in datetime.now(tzinfo=xxx)
and in the replace
method datetime.now().replace(tzinfo=xxx)
Example:
from datetime import datetime as dt
import pytz
dt.now().replace(tzinfo=pytz.timezone("Europe/Copenhagen")).tzname() # returns "LMT"
# whereas
dt.now(pytz.timezone("Europe/Copenhagen")).tzname() # returns "CEST"
applying e.g xx.astimezone(pytz.timezone("UTC"))
performs as expected in the "CEST"
-case whereas it is one hour off in the "LMT"
case.
Where am I going wrong?