I am trying to convert this complicated datetime format after getting this error:
[u"'Nov 11, 2017 5:19:38 AM PST' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]
I am building this function but I am not sure how to handle the Month as a word. This is an example of the date as it is in the CSV file: Nov 1, 2017 12:00:13 AM PDT
I am not having any luck:
def process_datetime(self,dt):
d_time = datetime.strptime(dt, '')
return datetime.strftime(d_time, 'YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ]')