"be consistent" | |
PerlMonks |
Re: Inconsistent results of subtraction with DateTime?by rjt (Curate) |
on Aug 07, 2013 at 19:37 UTC ( [id://1048424]=note: print w/replies, xml ) | Need Help?? |
DateTime says:
In short, subtract_datetime gives you an answer that includes days, minutes, and seconds between the two times. But delta_days essentially chops off the "time" part of your DateTime object and then does the subtraction, so you only get days. To see for yourself, try dumping the DateTime::Duration objects:
Output:
use strict; use warnings; omitted for brevity.
In Section
Seekers of Perl Wisdom
|
|