My original time is the string in this format:
2017-01-22 13:54:55
But in excel after opening the file, my date format becomes:
01/22/17 13:54:55
I tried to parse it as follows:
try:
return dt.strptime('01/22/17 13:54:55', '%Y-%m-%d %H:%M:%S')
except Exception as e:
try:
return dt.strptime('01/22/17 13:54:55', '%-m/%-d/%y %H:%M:%S')
except Exception as e:
raise ValueError('Reference time must be the format of: %Y-%m-%d %H:%M:%S, or a datetime object')
Is there the way to parse "01/22/17 13:54:55" by the strptime function?