Use time structure : Date Time « Development « Python
- Python
- Development
- Date Time
Use time structure

import time
gmt = time.gmtime(time.time())
fmt = '%a, %d %b %Y %H:%M:%S GMT'
str = time.strftime(fmt, gmt)
hdr = 'Date: ' + str
print hdr
Related examples in the same category