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.
In reply to Re: DateTime usage for duration computation
by derby
in thread DateTime usage for duration computation
by Marsel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |