Created
June 21, 2015 04:51
-
-
Save mohan43u/5a0617308dc1f9a2bc24 to your computer and use it in GitHub Desktop.
snip to calculate timedifference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import datetime | |
import sys | |
datetime0 = datetime.datetime.fromtimestamp(time.mktime(time.strptime(sys.argv[2], '%H:%M:%S'))) | |
datetime1 = datetime.datetime.fromtimestamp(time.mktime(time.strptime(sys.argv[1], '%H:%M:%S'))) | |
print(datetime0 - datetime1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment