You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.3 KiB

From: liw at (Lars Wirzenius)
Date: 13 Apr 1999 19:59:35 GMT
Subject: rfc822 date header
References: <>
Message-ID: <7f07n7$7pqv$>
Content-Length: 1048
X-UID: 235
jeffbauer at
> def strdate(self, timeval=None):
> from time import gmtime, strftime, time
> if timeval is None:
> timeval = time()
> return "Date: %s" % strftime('%a, %d %b %Y %H:%M:%S GMT',
> gmtime(timeval))
Here's what I wrote for Slime (thhe mailer I'm writing):
def _date_header(self):
"""Return Date header reflecting current time."""
# XXX this should probably communicate the local time zone
# somehow
t = time.gmtime(time.time())
return "Date: %s, %02d %s %04d %02d:%02d:%02d GMT\n" % \
Note that it isn't locale dependent.
(I apologize for the bad indentation of a whole tab, I haven't got around
to implementing proper indentation support in my editor.)