From 9665640794f0df80e62a7c90fd8b9514ca7f91cd Mon Sep 17 00:00:00 2001 From: vakeeshanvictor <33062640+vakeeshanvictor@users.noreply.github.com> Date: Mon, 8 Oct 2018 14:51:21 +0530 Subject: [PATCH] Create Birthday_counter.py --- code/Birthday_counter.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 code/Birthday_counter.py diff --git a/code/Birthday_counter.py b/code/Birthday_counter.py new file mode 100644 index 0000000..c9f7483 --- /dev/null +++ b/code/Birthday_counter.py @@ -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