You can use the Python time
module for various time-related functions. It appears you are requesting the following format:
Day Month Hour:Min:Sec Year
If so, you can use the following:
>>> import time
>>> time.asctime(time.localtime())
'Mon Jun 30 22:19:34 2014'
To convert to a specific format, you can use the following function:
time.strftime(format[, t])
This converts a struct_time
object tm
representing a time as returned by gmtime()
or localtime()
to a string. See the following link for more info on the format codes:
https://docs.python.org/2/library/time.html#time.localtime
Source: Beazley, D. M., "Python Essential Reference", 4th. Ed.