I'm trying to format a string with the format "2018-05-09T05: 05: 34Z" to "05/05/2018", but given the error ValueError: unconverted data remains
If I use:
dataAntiga = "2018-05-09T05:05:34Z"
datetime_object = parser.parse(dataAntiga)
dateTemp = datetime.strptime(str(datetime_object), '%Y-%m-%d %H:%M:%S')
The result is 2018-05-09 05:05:34+00:00
and gives the error:
ValueError: unconverted data remains: +00: 00
Your I directly use data = datetime.strptime(dataAntiga, '%Y-%m-%d %H:%M:%S')
, will also give the error:
ValueError: unconverted data remains