use Date::Manip; $day_of_year = 0 + UnixDate("3-Apr-2012", "%j");