From: liw at iki.fi (Lars Wirzenius)
Date: 25 Apr 1999 06:53:11 GMT
Subject: rfc822 date header
References: <37136310.62A6BE1A@rubic.com> <7f07n7$7pqv$1@midnight.cs.hut.fi>
Message-ID: <7fue4n$ekuj$1@midnight.cs.hut.fi>
X-UID: 1541                                                  

Lars Wirzenius <liw at iki.fi>:
> Here's what I wrote for Slime (thhe mailer I'm writing):

How embarrassing, the code I posted doesn't work. I'm pretty sure it
did work, at some point in time, but either I misremember, or I broke
it, or the stuff within rfc822 I use changed. Never mind, here is the
new version:

        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" % \
                        (string.capitalize(rfc822._daynames[t[6]]),
                         t[2],
                         string.capitalize(rfc822._monthnames[t[1] - 1]),
                         t[0],
                         t[3],
                         t[4],
                         t[5])




