[Zope3-dev] datetimeutils: add localize datetime?

Gustavo Niemeyer niemeyer at conectiva.com
Tue Feb 1 08:20:06 EST 2005


Greetings,

> It's not just guessing-based. It has documented behaviour [1] and tests,
> and the parsing is pluggable [2], which I think it's a must for any such
> functionality.

Indeed, it's almost not guessing. You may tell what dates to expect, and
which order is the expected one. OTOH, right now, it will try a different
order if the given one fails. This is wrong. An exception should be
issued in these cases, and that's how the next release will behave.

> We could write a parserinfo adapter or utility that would use the ICU
> to handle non-US date strings.

Yes.. localization and customization of the algorithm is done
externally, using a parserinfo class. Including a new language
is just a matter of creating a new parserinfo class, or even,
creating an i18n-aware class.

> Gustavo is usually hanging out on #zope3-dev under the nick
> 'niemeyer', so I'm sure he would be pleased to help us with this.

I'm here as well.. but right now I my attention is turned into
other projects that the company asked me to care about. Thanks
for pointing me to the thread Sidnei.

> Seems like there was a long thread [3] on python-dev about inclusion
> of dateutil in the std lib, not sure about the outcome though.

The same outcome of every thread on python-dev. Tons of diverse
opinions, some of them very harsh. I ended up losing my interest.

As I said at that time in python-dev, I'm willing to change part
of the behavior in dateutil if the rationale is provided, like
for the guessing issue (but please, let's not start another
one-thousand-messages-thread :-).

-- 
Gustavo Niemeyer
http://niemeyer.net


More information about the Zope3-dev mailing list