in reply to How do i get "the last day of last month"?
Additions above (I realized you might mean day of week and not date)!use Date::Calc qw( Today Days_in_Month Day_of_Week Day_of_Week_to_Text Add_Delta_YM ); my ( $year, $month, $date ) = Today(); ( $year, $month, $date ) = Add_Delta_YM( $year, $month, $date, 0, -1 ); my $day = ( Days_in_Month($year,$month) )[-1]; print $day, "\n"; print Day_of_Week_to_Text( Day_of_Week($year,$month,$day) ), "\n";
Update 2: D'oh! Re-corrected version to get last month's is now above.
|
|---|