Perl: the Markov chain saw | |
PerlMonks |
Re: How to get last month date periodby youlose (Scribe) |
on Mar 04, 2010 at 18:32 UTC ( [id://826777]=note: print w/replies, xml ) | Need Help?? |
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);
In Section
Seekers of Perl Wisdom
|
|