in reply to DateTime usage for duration computation
I think it's part misunderstanding and part bad documentation. Looking at DateTime, the subtract_datetime method returns a DateTime::Duration object. Looking at DateTime::Duration hours method, it's a a wrapper over the in_units method which when asking for hours, does an int on the numbers, effectively rounding the value (but probably not in a way you want).
update: I prefer Date::Manip for date calculations.
|
|---|