Create Birthday_counter.py

This commit is contained in:
vakeeshanvictor 2018-10-08 14:51:21 +05:30 committed by GitHub
parent 4da95e9a22
commit 9665640794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

22
code/Birthday_counter.py Normal file
View File

@ -0,0 +1,22 @@
import datetime
now = datetime.datetime.now()
print "-" * 25
print now
print now.year
print now.month
print now.day
print now.hour
print now.minute
print now.second
print "-" * 25
print "1 week ago was it: ", now - datetime.timedelta(weeks=1)
print "100 days ago was: ", now - datetime.timedelta(days=100)
print "1 week from now is it: ", now + datetime.timedelta(weeks=1)
print "In 1000 days from now is it: ", now + datetime.timedelta(days=1000)
print "-" * 25
birthday = datetime.datetime(2012,11,04)
print "Birthday in ... ", birthday - now
print "-" * 25