Mega Code Archive

 
Categories / Python / Development
 

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