Date::Calc woes

djberg96 on 2002-03-07T00:35:30

I'm using the Date::Calc::Object module in a script and I came across what I consider to be a bug. If you have two date objects and add them together, it doesn't recalculate each piece of time.

In other words, if you have 1 minute, 32 seconds (as an object) and add 45 seconds (again, as an object), you end up with 1 min, 77 seconds instead of 2 minutes, 17 seconds.

I've emailed the author. No response yet. We'll see if this is "normal" behavior or not. I'm a bit surprised at this, given how long this module has been around, though I think the OO is new.

This seems to be my forte' - finding bugs in other people's code.

UPDATE 7-Mar-2002

Steffen has informed me that Date::Calc doesn't do automatic normalization, even for objects, but it can be done using some other methods. I have proposed a 'normalize()' method in response.