/** * @static Returns the number of weeks in a Month. * * @param $month * @param $year * @param string $timeZone * * @return float */ public static function weeksInMonth($month, $year, $timeZone = 'America/Los_Angeles') { date_default_timezone_set($timeZone); $first_day_of_week = 0; return ceil((CalendarUtil::daysInMonth($month, $year) + (7 + CalendarUtil::firstDayOfMonth($month, $year) - $first_day_of_week) % 7) / 7); }