Re: Conversion from date string back to date?

Guido.van.Rossum@cwi.nl
Sat, 24 Sep 1994 09:44:22 +0200

> I'm using the mailbox.py code to do some statistics on mail messages. It
> allows a function to return a messages date in a format like:
> 'Mon, 6 Jun 94 09:12:34 PDT'
>
> Any suggestions on getting that into a format usable by some of the date
> manipulation stuff?

Actially, the module uses rfc822.py to parse the message's header,
which contains a function getdate() which returns the date in a format
that's acceptable for time.mktime(). There's one flaw: it doesn't
handle dst strings yet, and some mailers put entirely illegal stuff in
the date fields so it will never reach an accuracy of 100% -- but it
could get pretty darn close with only a little more work...

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>