1👍
✅
If you want to manipulate time zones you need to be working with datetime
objects. Create one with datetime.combine
:
from datetime import datetime
from datetime.timezone import utc
dt = datetime.combine(self.date, self.time, utc)
At that point you have an aware datetime
object and can convert it to another timezone, print it out, etc.
Source:stackexchange.com