use Date::Manip; $input = "June 2006"; # these also work: #$input = "2006 june"; #$input = "today"; #$input = "June 2006"; $thismonth = UnixDate($input, "%B %Y"); $lastofmonth = DateCalc($thismonth, "+1 month -1 day"); $dow_lastofmonth = UnixDate($lastofmonth, "%A\n"); print $dow_lastofmonth;