How to localize a
#localize #timezone #pytz #astimezone #replace
UTC
date?import pytz
import datetime
date_format = '%Y-%m-%d %H:%M:%S'
dt = datetime.datetime.strptime('2018-12-12 00:00:00', date_format)
utc_tz = pytz.timezone('UTC')
utc_d = utc_tz.localize(dt)
teh_tz = pytz.timezone('Asia/Tehran')
dt = utc_d.astimezone(teh_tz)
#localize #timezone #pytz #astimezone #replace