from pytz import timezone
import datetime
utc = datetime.timezone.utc
tz = timezone("Europe/London")
now = datetime.datetime.now(utc)
date = now.replace(tzinfo=tz)
date_utc = date.astimezone(utc)
print(now.isoformat())
print(date.isoformat())
print(date_utc.isoformat())
Might print:
2021-12-01T21:30:09.170108+00:00
2021-12-01T21:30:09.170108-00:01 <---- why does it say -00:01 here?
2021-12-01T21:31:09.170108+00:00
Why on earth is there a one minute shift? Am I missing some fundamental knowledge on time zones?