We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 50b2cf0 + 5189e3c commit 75d7a9aCopy full SHA for 75d7a9a
1 file changed
date and time in python.py
@@ -0,0 +1,23 @@
1
+
2
+import datetime
3
+now = datetime.datetime.now()
4
+print "-" * 25
5
+print now
6
+print now.year
7
+print now.month
8
+print now.day
9
+print now.hour
10
+print now.minute
11
+print now.second
12
13
14
+print "1 week ago was it: ", now - datetime.timedelta(weeks=1)
15
+print "100 days ago was: ", now - datetime.timedelta(days=100)
16
+print "1 week from now is it: ", now + datetime.timedelta(weeks=1)
17
+print "In 1000 days from now is it: ", now + datetime.timedelta(days=1000)
18
19
20
+birthday = datetime.datetime(2012,11,04)
21
22
+print "Birthday in ... ", birthday - now
23
0 commit comments