[Zope-dev] DateTime.rfc822() bug?

Geir Bækholt Geir Bækholt
Sun, 13 Oct 2002 16:15:42 +0200


Hello Lennart, 

Friday, October 11, 2002, 2:00:03 PM, you wrote:

LR> RFC 2822 (which is the currently valid one, if I understand correctly)
LR> specifies the date format to have four digit zone specifications, ie
LR> "GMT+0200", while DateTime.rfc822() happily returns "GMT+2". Not that this
LR> seems to be any problem, I'm just looking for an answer if this is how it's
LR> supposed to be?

i can confirm that this is a bug in DateTime.rfc822(), and that
rfc-conformant mailclients choke on it aswell..

i believe it has been reported to the lists before , and i believe i
have also seen it in the collector..

(the collector seems to be down , but i found this request on google..
http://mail.python.org/pipermail/zope-collector-monitor/2002-May/000652.html
)

Your concerns are valid.
i usually solve it by use of a small script(python) somewhat
resembling this :

# params   indate
fmtstr = "%a, %d %b %Y %X +0200"
return indate.strftime(fmtstr)



-- 
Geir Bækholt
geirh@funcom.com