With a date in string in 01/01/2018 13:00:40
format, how could I convert it to iso
format using "T"
and "Z"
, example: 2018-01-01T13:00:40Z
I was able to do this as follows;
datetime.strftime(
datetime.strptime("01/01/2018 13:00:40", "%d/%m/%Y %H:%M:%S"),
"%Y-%m-%dT%H:%M:%SZ"
)
But I do not think it's the best way, is there any other method for this conversion?