Python code to sum between two dates and times

If I have an excel file with the dates and times how do I create a code that will sum the number between certain dates and times?

I would guess:

  • read the Excel file; I usually use openpyxl for this, but pandas
    can read them too and there are other packages
  • get the “sheet” containing the dta you want, scan the rows to get your
    pairs of date/times according to your criteria
  • subtract the pairs
  • sum the differences?

Cheers,
Cameron Simpson cs@cskk.id.au