[Zope-Coders] Replace Zope2 DateTime._parse() with Zope3's DateTimeParser

Andreas Jung andreas@andreas-jung.com
Fri, 22 Nov 2002 15:00:51 +0100


--On Freitag, 22. November 2002 14:36 +0000 Steve Alexander 
<steve@cat-box.net> wrote:

> Andreas Jung wrote:
>
>> Just an idea:
>>
>> Since the DateTime parser of Zope 2 is broken for ages (e.g.
>> "05.12.2002" is interpreted as May  12, 2002)  I found the
>> DateTimeParse module in Zope 3.
>
> Why is this broken?
>
> If the documentation says "parses ambiguous spec according to the US
> convention" then I don't see it as being broken.

Ok I agree. I was not aware of this behaviour.
But at least it is a design flaw not to provide a valid support for european
or not to issue a warning in this case.

>
> Then again, I'd much perfer a DateTime parser that raises an exception on
> such ambiguous input, leaving it up to an application programer to be
> explicit about whether the US convention is to be used or not.

Btw. DateTimeParser.py has the same problem and does not raise an exception
for ambigious input. The current behaviour makes it hard for European users
to use DateTime. Imagine you enter a European date and pass it to the 
DateTime
module. I am pretty sure that most Zope 2 users and developers don't know
about this problem. I really would like to see a configuration option or 
switch
where I can specify "parse this date as european date".

Cheers,
Andreas