I am trying to parse a str as a datetime.datetime object. However, I am unable to achieve this because the timezone is GST.
import datetime s_dt = 'Mon Jul 01 17:17:37 UTC' datetime.datetime.strptime(s_dt, '%a %b %d %H:%M:%S %Z') # datetime.datetime(1900, 7, 1, 17, 17, 37) s_dt = 'Mon Jul 01 17:17:37 GST' datetime.datetime.strptime(s_dt, '%a %b %d %H:%M:%S %Z') # ValueError: time data 'Mon Jul 01 17:17:37 GST' does not match format '%a %b %d %H:%M:%S %Z' How can I fix this?