All you need is in the documentation.
import time
time.strftime('%X %x %Z')
'16:08:12 05/08/03 AEST'
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"))
import time
time.strftime('%H:%M%p %Z on %b %d, %Y')
You could do something like:
>>> from time import gmtime, strftime
>>> strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
'Thu, 28 Jun 2001 14:17:15 +0000'
The full doc on the % codes are at http://docs.python.org/library/time.html
Source: Stackoverflow.com