calculate difference between two time in hour
<p>I want to calculate difference between two time in hours using <code>django</code> in <code>sql db</code> the time are stored in timefield.</p>

<p>I tried this: </p>

<pre><code>def DesigInfo(request):  # attendance summary
  emplist = models.staff.objects.values('empId', 'name')
  fDate = request.POST.get('fromDate')
  tDate = request.POST.get('toDate')

  if request.GET.get('empId_id'):
    sel = attendance.objects.filter(empId_id=request.GET.get('empId_id'),)
    for i in sel:
        # print i.
        # print   i.outTime
        # print i.inTime.hour,i.inTime.minute,i.inTime.second - i.outTime.hour,i.outTime.minute,i.outTime.second
        ss = i.inTime.hour
        ss1 = 12 - ss
        mm = i.outTime.hour
        mm1 = (12 + mm) - 12
        print ss1 + mm1
</code></pre>