In Python, how to display current time in readable format

Viewed 168717

How can I display the current time as:

12:18PM EST on Oct 18, 2010

in Python. Thanks.

6 Answers

By using this code, you'll get your live time zone.

import datetime
now = datetime.datetime.now()
print ("Current date and time : ")
print (now.strftime("%Y-%m-%d %H:%M:%S"))
Related