Answer to Question #295498 in Python for Suresh

Question #295498

Date format-2

1
Expert's answer
2022-02-09T05:55:20-0500
# 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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS