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");
In reply to Re: How to get last month date period
by ambrus
in thread How to get last month date period
by roborat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |