Hi I am trying to convert the following time format
2020-08-28T13:42:00.298363-05:00
to
28-Sept-2020
I am using the following code but it does not work.
from datetime import datetime
start_time = "2020-08-28T13:42:00.298363-05:00"
start_period_obj = datetime.strptime(start_time, "%Y-%m-%dT%H:%M:%f.%-s-%z)
print(start_period_obj)
and the output is
File "time conveter.py", line 19
start_period_obj = datetime.strptime(start_time, "%Y-%m-%dT%H:%M:%f.%-s-%z)
^
SyntaxError: EOL while scanning string literal