Thomas Klausner wrote:
>The only potential deal-breaker is the fact that if you now create a new 
>DateTime that does not exists, you'll get the next valid time instead of 
>an exception

Getting an exception in this situation is a feature, not a bug.  Finding
the next valid local time is potentially useful behaviour, but it needs
to be invoked explicitly, perhaps by an extra constructor parameter.

>Oh, and requesting a specific non-existed time also has strange results:
>~$ perl -MDateTime -E 'say 
>DateTime->new(year=>2012,month=>10,day=>21,hour=>0,minute=>30,time_zone=>"America/Sao_Paulo")'
>2012-10-21T01:30:00

If you're going to advertise this feature as "find the next valid local
time", you need to handle cases like this correctly.

-zefram

Reply via email to