Last active
June 12, 2020 17:35
-
-
Save nitesh8860/33191019fd7578d0a5e35f435e34f517 to your computer and use it in GitHub Desktop.
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
from datetime import datetime | |
t1='Sat 02 May 2015 19:54:36 +0530' | |
t2='Fri 01 May 2015 13:54:36 -0000' | |
t1=datetime.strptime(t1,'%a %d %b %Y %H:%M:%S %z') | |
t2=datetime.strptime(t2,'%a %d %b %Y %H:%M:%S %z') | |
# print(t1-t2) | |
#> 1 day, 0:30:00 | |
print ((t1-t2).total_seconds()) | |
#> 88200.0 | |
#http://archive.oreilly.com/oreillyschool/courses/Python3/Python3-13.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment