I am trying to initialize a time object like this:
t = datetime.time(0,0,0)
but I am getting this error:
descriptor 'time' requires a 'datetime.datetime' object but received a 'int'
I have these things imported
import datetime
from datetime import datetime, date, time
import time
They seem a bit redundant so I am wondering if this is what is causing the problem
I am also using the strptime method and the combine method
earliest = datetime.combine(earliest, t)
value = datetime.strptime(value, format)
You can create the object without any values:
You, however, imported the class datetime from the module, replacing the module itself:
and that has a different signature:
Either import the whole module, or import the contained classes, but don’t mix and match. Stick to:
if you need both modules.