#!/usr/bin/perl use DateTime; $a = DateTime->new(year=>1952,month=>10,day=>21); $b = DateTime->new(year=>2015,month=>10,day=>31); $dif = $b-$a; print $dif->years() ." ". $dif->months() ." ". $dif->days();
Where did he get 3 days from? My expectation is 63 0 10.
#!/usr/bin/perl use DateTime; $a = DateTime->new(year=>1952,month=>11,day=>1); $b = DateTime->new(year=>2015,month=>10,day=>31); $dif = $b-$a; print $dif->years() ." ". $dif->months() ." ". $dif->days();
My expectation for this is 62 11 31 or so.
I am trying to make a base date of birth before math. The month and year seem to work as I expect, but this day seems unpredictable. I read the CPAN documentation, but I still do not understand.
datetime time perl
Fletcher moore
source share