in reply to perl script to calculate beg and end of current month
use DateTime; my $today = DateTime->today(); my $last_month = $today->subtract( months => 1 ); my $first = $last_month->clone()->set_day(1); my $last = $first->add( months => 1 )->subtract( days => 1 ); print "first=$first last=$last\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl script to calculate beg and end of current month
by Ace28 (Initiate) on Jul 16, 2008 at 14:09 UTC | |
by Anonymous Monk on Nov 09, 2009 at 05:24 UTC |