Skip to content

Instantly share code, notes, and snippets.

@hersonls
Created April 16, 2013 20:05
Show Gist options
  • Save hersonls/5399157 to your computer and use it in GitHub Desktop.
Save hersonls/5399157 to your computer and use it in GitHub Desktop.
from datetime import datetime
t1 = "09:30:00"
t2 = "13:45:00"
start_dt = datetime.strptime(t1, '%H:%M:%S')
end_dt = datetime.strptime(t2, '%H:%M:%S')
diff = (end_dt - start_dt)
print diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment