def difft(start, end):
    a, b, c, d = start.hour, start.minute, start.second, start.microsecond
w, x, y, z = end.hour, end.minute, end.second, end.microsecond
delt = (w - a) * 60 + (x - b) + (y - c) / 60.0 + (z - d) / 60000000
return delt + 1440 if delt < 0 else delt
how to substract two datetime.time values in django template,and how to format a duration as hour,minutes