in reply to Given month last day
use strict; use warnings; use Time::Piece; my $month = 11; my $t = Time::Piece->strptime($month, '%m'); my $last_day_month = $t->month_last_day(); print "$last_day_month\n"; __END__ 30
To account for leap years, you may need to also specify the year.
|
|---|