
Edgar Meij wrote:
Hi Damir,
One quick question... I've been looking at (and working with :) ) your interval_to_seconds sub in conjunction with Date::Manip. One problem arises though. If a ticket is more than a month old, the DateCalc delta returns months as well. They get chunked off however when parsing to minutes. Have you considered this?
Thanks for noticing that - I haven't, mostly due to fact that I've used it for monthly statistics. My data did not contain any tickets that haven't been answered for so long so it never showed up. Although DateCalc function provides various modes of interval calculations mode-0: +0:0:1071:2:3:10:10 -> 647925010 sec mode-1: +20:6:1:4:3:10:10 mode-2: +20:6:0:7:0:0:0 -> 604800 sec (false!) not all of them make sense over such large interval like a month, or 2 years. In my program I used mode-2 (business date calculation). As you noticed, that will give false result for number of seconds in that interval (since only 4 fields of lowest-significance are used). To correct that problem I'll add other fields in calculation. Months will be converted to days with factor 30.5 which will sure give more "precise" result than algorithm currently used. :) Maybe someone will benefit from it, although I would not like to use customer support system which is that responsive. :) Anyway, correctness first. Thanks for the bug report. Kind Regards, D.