Formatting RFC 822 date

brey at ductape.net brey at ductape.net
Tue Apr 3 14:25:45 EDT 2001


I'm using smtplib to send an email message, and I'd like to put a Date: line
in the header.  However, formatting the timezone portion of the date line
correctly seems to be a real highly non-trivial.  time.strftime only outputs
the time zone as a string, and none of the variables in the time module are
easy to convert to the -600 style format.  Ironically, there is
rfc822.parsedate, which does the opposite of what I need (and is probably
much harder to write).

Is there a module that I'm missing that will take a time tuple and output the
proper RFC 822 date string?

Thanks in advance,
Ed


 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse at newsone.net



More information about the Python-list mailing list