Skip to content

Instantly share code, notes, and snippets.

@raninho
Created October 24, 2019 18:45
Show Gist options
  • Save raninho/d4efac534ffc53a678e36f3ed84305cf to your computer and use it in GitHub Desktop.
Save raninho/d4efac534ffc53a678e36f3ed84305cf to your computer and use it in GitHub Desktop.
from datetime import datetime, timedelta
if __name__ == "__main__":
date1 = "15:59:02"
date2 = "16:59:02"
d1 = datetime.strptime(date1, "%H:%M:%S")
d2 = datetime.strptime(date2, "%H:%M:%S")
d = d2 - d1
print(d.total_seconds())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment