We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5170a1f + 18c2049 commit 97b3d10Copy full SHA for 97b3d10
snippets/python/date_and_time.md
@@ -0,0 +1,16 @@
1
+# Check Current Date and Time
2
+
3
+*tags:* python, datetime
4
5
+`datetime`: The datetime module supplies classes for manipulating dates and times.
6
7
+### Snippet
8
+```
9
+import datetime
10
11
+# now() method returns current datetime object
12
+cur_time = datetime.datetime.now()
13
14
+print("Date today:",f"{cur_time:%Y-%m-%d}")
15
+print("Time:", f"{cur_time:%H:%M:%S%z}")
16
0 commit comments