Date format-2
# python program to diplay current date and time using Date Format-2
import datetime
now = datetime.datetime.now()
print ("Current date and time : ")
# Formatting output to take Date Format 2
print (now.strftime("%Y/%m/%d %H:%M:%S"))
#the output will look like below
Comments
Leave a comment