Trying to go from creating a datetime object from a string all the way through to using .time() to just pull the time.
Can you help with the error please? Thanks!
test_datetime = "1/8/1990 19:32:05"
td_time = dt.strptime(test_datetime, "%M/%d/%Y %H:%m:%S")
td_time = td_time.time()
print(td_time)
I am getting this error message:
Traceback (most recent call last):
File "/root", line 83, in <module>
td_time = dt.strptime(test_datetime, "%M/%d/%Y %H:%m:%S")
File "root", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "root", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '1/8/1990 19:32:05' does not match format '%M/%d/%Y %H:%m:%S'