Created
July 23, 2018 10:42
-
-
Save prerakmody/e5522a37b73bdfa48bca3170f04bb932 to your computer and use it in GitHub Desktop.
Python Datetime
This file contains hidden or 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
import datetime | |
if __name__ == "__main__": | |
a = datetime.datetime.strptime('2011-09-26 14:14:11.124700931'[:-3], '%Y-%m-%d %H:%M:%S.%f') | |
b = datetime.datetime.strptime('2011-09-26 14:15:16.432700931'[:-3], '%Y-%m-%d %H:%M:%S.%f') | |
diff = (b-a) | |
print (diff.seconds, diff.microseconds) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment