Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to get last month date period

by ambrus (Abbot)
on Mar 04, 2010 at 17:13 UTC ( #826747=note: print w/ replies, xml ) Need Help??


in reply to How to get last month date period

As with most time and date manipulation, I recommend the Date::Manip module.

use Date::Manip; # this is the current month my $current = ParseDate("today"); # or = ParseDate("january 2010") or +whatever # now let's find the last day of the previous month $last_month_last_day = DateCalc(UnixDate($current, "%Y-%m"), "-1 day") +; # then we print the interval print UnixDate($last_month_last_day, "01 %b %Y - %d %b %Y\n");


Comment on Re: How to get last month date period
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-12-28 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (180 votes), past polls