in reply to How to get last month date period
use DateTime; use Modern::Perl; my $fdm = DateTime->now->subtract(months=>1)->truncate(to=>'month'); my $ldm = DateTime->last_day_of_month(year=>$fdm->year,month=>$fdm->month); my $stf_pat = '%d %b %Y'; say $fdm->strftime($stf_pat),' - ',$ldm->strftime($stf_pat);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get last month date period
by kivilahtio (Initiate) on Dec 22, 2014 at 09:51 UTC |