rfc822 date header

M.-A. Lemburg mal at lemburg.com
Tue Apr 13 03:39:45 EDT 1999


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/  :
           ---------------------------------------------------------





More information about the Python-list mailing list