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