title: How do I find the time difference between two events using the Google calender api python
body: <p>I'm trying to create a program which checks my Google calender when I have been in work and whether it was overtime or normal rate and then calculate the amount I should be paid for that month. I have read over the Google API reference but I have had no luck. Here is my Pseudo code: </p>
  
  <pre><code>Get events for month
  Write events to file split each value with comma
  Check each event for keyword work else remove from file
  For each line check amount of hours worked and append to end of line
  If day = Sunday or event name = work (Overtime BH) append value to BankHolidayHours Variable
  If day = Thursday or Saturday append value to ContractedHours variable
      Else write to OvertimeHours variable 
  BankHolidayTotal = BankHolidayHours * BHRate
  ContractedHoursTotal = ContractedHours * CHRate
  OvertimeHoursTotal = OvertimeHours * OHRate
  Print OvetimeHoursTotal &amp; ContractedHoursTotal &amp; BankHolidayTotal to screen
  </code></pre>
  
  <p>Any help will be much appreciated thanks.</p>