wasm-demo/demo/ermis-f/python_m/cur/0525

37 lines
1.1 KiB
Plaintext

From: mal at lemburg.com (M.-A. Lemburg)
Date: Tue, 13 Apr 1999 07:39:45 GMT
Subject: rfc822 date header
References: <3712D863.2A8148BC@rubic.com>
Message-ID: <3712F4C1.52327AF4@lemburg.com>
X-UID: 525
Jeff Bauer wrote:
>
> Is there a reasonably bulletproof way to generate an
> rfc822-compliant date header using the time module?
>
> The reason I ask is I recall a number of subtle
> errors in this regard, reported by Chris Lawrence,
> among others.
According to the RFC, time.ctime() should do the trick...
but it's probably locale aware which the RFC doesn't account
for.
A better way is to use the ARPA submodule in mxDateTime:
http://starship.skyport.net/~lemburg/mxDateTime.html
...even if it's just for looking up the string format ;-)
--
Marc-Andre Lemburg Y2000: 262 days left
---------------------------------------------------------------------
: Python Pages >>> http://starship.skyport.net/~lemburg/ :
---------------------------------------------------------