In this example, i’ll show you how to display the current date and time in Python.
Python Code:
1 2 3 4 5 6 | import datetime now = datetime.datetime.now() print ("Current date and time : ") print (now.strftime("%Y-%m-%d %H:%M:%S")) |
Output:
In this example, i’ll show you how to display the current date and time in Python.
Python Code:
1 2 3 4 5 6 | import datetime now = datetime.datetime.now() print ("Current date and time : ") print (now.strftime("%Y-%m-%d %H:%M:%S")) |
Output: