i want to calculate difference in seconds, between two dates.
def delta_seconds(datetime, origin):
td = datetime - origin # datetime - date
return float((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6)) / 10 ** 6
I can't compute the difference and it shows me this error:
TypeError: unsupported operand type(s) for -: 'datetime.time' and 'datetime.datetime
So, i want to convert datetime.time into datetime.datetime.
(datetime is a datetime.time obj and origin is a datetime.datetime obj)
Any suggestion?