Skip Menu |

This queue is for tickets about the DateManip CPAN distribution.

Report information
The Basics
Id: 21538
Status: resolved
Priority: 0/
Queue: DateManip

People
Owner: Nobody in particular
Requestors: monerjan [...] rhrk.uni-kl.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Wrong Calculation by DateCalc
Date: Sun, 17 Sep 2006 15:48:06 +0200
To: bug-DateManip [...] rt.cpan.org
From: Martin Monerjan <monerjan [...] rhrk.uni-kl.de>
DateManpVersion = 5.44 Perl = 5.8.8 Uname = Linux charon 2.6.16.21-0.13-default #1 Mon Jul 17 17:22:44 UTC 2006 i686 athlon i386 GNU/Linux DateCalc mysteriously decides no longer to subtract but rather to add times. I fed the following timestamps into DateCalc and asked to compute the deltas: 00:00:00:00:00:00 00:00:00:00:09:34 00:00:00:00:15:28 00:00:00:00:19:26 00:00:00:00:25:17 00:00:00:00:40:03 00:00:00:00:57:09 00:00:00:00:62:56 The result yielded: Start: 00:00:00:00:00:00 End: 00:00:00:00:09:34 Delta: 9:34 Start: 00:00:00:00:09:34 End: 00:00:00:00:15:28 Delta: 25:2 Start: 00:00:00:00:15:28 End: 00:00:00:00:19:26 Delta: 34:54 Start: 00:00:00:00:19:26 End: 00:00:00:00:25:17 Delta: 44:43 Start: 00:00:00:00:25:17 End: 00:00:00:00:40:03 Delta: +0:0:0:0:1:5:20 Start: 00:00:00:00:40:03 End: 00:00:00:00:57:09 Delta: +0:0:0:0:1:37:12 Start: 00:00:00:00:57:09 End: 00:00:00:00:62:56 Delta: +0:0:0:0:2:0:5 Start: 00:00:00:00:62:56 End: 00:00:00:00:1:15:16 Delta: +0:0:0:0:2:18:12 Interestingly the error(?) also occurs when both arguments are below one hour. Sincerely yours Martin Monerjan
The input given here is incorrect (from a separate email sent to the author of the bug report). The correct input should be: 00:00:00 00:09:34 00:15:28 ... The results are unexpected, but not a bug. Data passeed in to DateCalc may be either a delta or a date... and it tries dates first. And the delta between "today at 00:09:34" and "today at 00:15:28" is correctly returned as the delta "5:54". I've fixed the documentation to clarify this, and point out that all data sent to DateCalc should first be passed to ParseDate or ParseDateDelta.