I can't figure out how to show a timezone-aware datetime without the trailing offset.
My class has a property "date_created", which saves the datetime, and I am working with Python 3.7. I could not find a built-in function that suited my needs, or I'm too blind to find it in the docs. However, here is what I am trying to do:
Current simplified code:
print(f'Creation Date (UTC): {self.date_created}')
print(f'Creation Date (local): {self.date_created.astimezone()}')
Results (as expected):
>>> Creation Date (UTC): 2021-08-03 10:37:12
>>> Creation Date (local): 2021-08-03 10:37:12+02:00
What I am trying to achieve is:
>>> Creation Date (UTC): 2021-08-03 10:37:12
>>> Creation Date (local): 2021-08-03 12:37:12
Is there a built-in method to do this or do I really have to write something that will "recalculate" my local datetime?