[Python-Dev] dateutil

Gerrit gerrit at nl.linux.org
Sat Mar 13 11:01:07 EST 2004


Gustavo Niemeyer wrote:
> Some people claim that this is "dangerous", since there are
> ambiguous dates, like "03-03-03".

I don't think 03-03-03 is very ambigious, maybe 03-04-05 would be a
better example ;-)

> In my opinion, this is completely
> non-sense, since dateutil's parsing routine has a well defined,
> documented, and simple behavior. If you're parsing US dates, the default
> is ok. If you're parsing brazilian dates, pass it "dayfirst=1" and
> you're done. What other ways would you parse it!?

Year first, perhaps, but I think it would be yyyy-mm-dd instead of
yy-mm-dd then. But perhaps it would be nice to enable a (surpressable,
of course) warning when a date is multi-parsable...?

> Ahh.. of course.
> Perhaps you'd prefer to say "%a, %d %b %Y %H:%M:%S %z" than
> "dayfirst=1", since it's a lot more obvious what you're parsing, isn't
> it?  ;-)

It may be faster.

Gerrit.

-- 
Weather in Amsterdam Airport Schiphol, Netherlands 13/03 14:55 UTC:
	10.0°C Few clouds mostly cloudy wind 9.8 m/s SW (-2 m above NAP)
-- 
Asperger's Syndrome - a personal approach:
	http://people.nl.linux.org/~gerrit/english/



More information about the Python-Dev mailing list