Python program to display the current date and time
code:-
import datetime
now = datetime.datetime.now()
print ("Current date and time : ")
print (now.strftime("%Y-%m-%d %H:%M:%S"))
output:-
Current date and time :
2021-10-02 16:06:23
Python program to display the current date and time
code:-
import datetime
now = datetime.datetime.now()
print ("Current date and time : ")
print (now.strftime("%Y-%m-%d %H:%M:%S"))
output:-
Current date and time :
2021-10-02 16:06:23
Post a Comment
If you have any doubts, Please let me know
Thanks!