Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to get last month date period

by youlose (Scribe)
on Mar 04, 2010 at 18:32 UTC ( #826777=note: print w/ replies, xml ) Need Help??


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);


Comment on Re: How to get last month date period

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://826777]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-09-20 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls