Days between two dates
perl at aaroncrane.co.uk
Thu Dec 22 15:45:17 GMT 2005
Paul Makepeace writes:
> A should-be-obvious question. How does one find the number of days
> between two dates, without converting to epoch?
With DateTime (as in your example) it looks like this:
$ perl -MDateTime -lwe '
$s = DateTime->new(year => 2005, month => 10, day => 1);
$d = DateTime->new(year => 2005, month => 12, day => 1);
Yes, it does seem bizarre that you call ->delta_days twice, on different
types of object.
More information about the london.pm