I want to convert a datestring into another date format.
The datestring
2014-11-20T00:00:00.000Z
The code
datetime.datetime.strptime(date, '%Y-%m-%dT%H:%M:%S%Z').strftime('%Y%m%d')
The error
time data '2014-11-20T00:00:00.000Z' does not match format '%Y-%m-%dT%H:%M:%S%Z'
I can read the error message but I cannot find the right format that matches the datestring.
To include the millisecond paramater use this:
datetime.datetime.strptime(d, '%Y-%m-%dT%H:%M:%S.%fZ').strftime('%Y%m%d')