use DateTime; my $today = DateTime->today( time_zone => 'local' ); my $dur = $today->delta_days( $today->clone->subtract( years => 1, months => 1 ) ); print( $dur->in_units( 'days' ), " days\n" );
There's also ->delta_md if you want month+days instead of just days.
In reply to Re: How can I count the days between two dates?
by ikegami
in thread How can I count the days between two dates?
by zby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |