Formatting RFC 822 date
Barry A. Warsaw
barry at digicool.com
Wed Apr 4 17:25:16 EDT 2001
>>>>> "MDC" == Matthew Dixon Cowles <matt at mondoinfo.com> writes:
>> Is there a module that I'm missing that will take a time tuple
>> and output the proper RFC 822 date string?
MDC> I'll append what I do in Swallow. I think it's right.
How about rfc822.formatdate()? :)
>>> import time
>>> import rfc822
>>> rfc822.formatdate()
'Wed, 04 Apr 2001 21:23:07 GMT'
>>> rfc822.formatdate(time.time() - 3600)
'Wed, 04 Apr 2001 20:23:23 GMT'
Okay, so it takes a time float, but you can easy convert a time tuple
to a time float via time.mktime().
Cheers,
-Barry
More information about the Python-list
mailing list