Have error
ValueError: time data '2012-03-15 9:45:00 AM' does not match format '%Y-%m-%d %H:%M:%S'
How do convert to datetime? The problem is am/pm, the %I:%M:%S%p isn’t working for me.
I need the date to add it to time.strftime("%H:%M:%S", (0,0,0,8,56,0,0,0,0))
Edit Two: trying to use…
**
import time
from time import strftime
from datetime import date, time, datetime
**
These imports in this order cause a problem with
start_time= time.time()
start_time = time.time()
AttributeError: type object 'datetime.time' has no attribute 'time'
old edits……
datetime.combine(y='a date',z= 'a time')
y is datetime.date
z is datetime.time
y=datetime(t.year, t.month, t.day) this solved.
gives a problem.
z is datetime.time
datetime.combine(y, datetime.time(18, 54, 32))
error message………….
a =datetime.combine(y, datetime.time(18, 54, 32))
TypeError: descriptor 'time' requires a 'datetime.datetime' object but received a 'int'
Concerning the update: you have a mess in imports from datetime module. The correct sample is: