1#as an aware datetime
2from datetime import datetime, timezone
3
4utc_dt = datetime.now(timezone.utc) # UTC time
5dt = utc_dt.astimezone() # local time
6
7
8#or from pytz database
9import pytz
10
11tz = pytz.timezone('Europe/Berlin')
12berlin_now = datetime.now(tz)