Program to print current date and time in python

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
>>>




Leave a Reply

Your email address will not be published.