This time I’ll show you how to print current date and time with Python.
You will need datetime module for that.
Thew code is:
import datetime now = datetime.datetime.now() print("The current date and time is: ") print(now.strftime("%y-%m-%d %H:%M:%S"))
And the output of the script is:
The current date and time is: 21-02-09 17:27:00
Now you know how to print date and time in Python. You know also when I created this article 😉