[Python-Dev] mxDatTime parser (was: New Subscriber Introduction)
Oleg Broytmann
Oleg Broytmann <phd@phd.pp.ru>
Tue, 25 Jun 2002 14:40:31 +0400
On Tue, Jun 25, 2002 at 12:21:31PM +0200, M.-A. Lemburg wrote:
> >>Just curious: have you taken a look at the mxDateTime parser ?
> >
> > is that an extension of the rfc822.parsedate approach?
>
> Yes, but it goes far beyond RFC822 style dates and times.
>>> from mx import DateTime
>>> dt = DateTime.DateTimeFrom("21/12/2002")
>>> dt
<DateTime object for '2002-06-25 20:02:00.00' at 819d7f8>
>>> dt = DateTime.DateTimeFrom("21/08/2002")
>>> dt
<DateTime object for '2002-06-25 20:02:00.00' at 819b860>
>>> dt = DateTime.DateTimeFrom("21-08-2002")
>>> dt
<DateTime object for '2021-08-20 00:00:00.00' at 819d7f8>
I am not sure I understand the logic. Because of this I always use ISO
date format (2002-08-21).
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.