use DateTime; my $today = DateTime->today(); my $last_month = $today->subtract( months => 1 ); my $first = $last_month->clone()->set_day(1); my $last = $first->add( months => 1 )->subtract( days => 1 ); print "first=$first last=$last\n";
In reply to Re: perl script to calculate beg and end of current month
by saintmike
in thread perl script to calculate beg and end of current month
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |