import datetime now = datetime.datetime.now() print ("Current date and time : ") print (now.strftime("%Y-%m-%d %H:%M:%S")) Output:- >>> = RESTART: C:/Users/Rajnish Tripathi/AppData/Local/Programs/Python/Python38-32/date.py 29-08-2020 14:07:40 >>>
import datetime now = datetime.datetime.now() print ("Current date and time : ") print (now.strftime("%Y-%m-%d %H:%M:%S"))
0 Comments