src/Utility/Time.php
public static function cWeekBeginning($year, $cWeek = 0) {
		if ($cWeek <= 1 || $cWeek > static::cWeeks($year)) {
			$first = mktime(0, 0, 0, 1, 1, $year);
			$wtag = (int)date('w', $first);

			if ($wtag <= 4) {
				/* Thursday or less: back to Monday */
				$firstmonday = mktime(0, 0, 0, 1, 1 - ($wtag - 1), $year);
			} elseif ($wtag != 1) {
				/* Back to Monday */
				$firstmonday = mktime(0, 0, 0, 1, 1 + (7 - $wtag + 1), $year);
			} else {
				$firstmonday = $first;
			}
			return $firstmonday;
		}
		$monday = strtotime($year . 'W' . static::pad($cWeek) . '1');
		return $monday;
	}
public static function cWeekBeginning($year, $cWeek = 0) {
		if ($cWeek <= 1 || $cWeek > static::cWeeks($year)) {
			$first = mktime(0, 0, 0, 1, 1, $year);
			$wtag = (int)date('w', $first);

			if ($wtag <= 4) {
				/* Thursday or less: back to Monday */
				$firstmonday = mktime(0, 0, 0, 1, 1 - ($wtag - 1), $year);
			} elseif ($wtag != 1) {
				/* Back to Monday */
				$firstmonday = mktime(0, 0, 0, 1, 1 + (7 - $wtag + 1), $year);
			} else {
				$firstmonday = $first;
			}
			return $firstmonday;
		}
		$monday = strtotime($year . 'W' . static::pad($cWeek) . '1');
		return $monday;
	}
public static function cWeekBeginning ( $ year , $ cWeek = 0 ) { if ( $ cWeek <= 1 || $ cWeek > static :: cWeeks ( $ year ) ) { $ first = mktime ( 0 , 0 , 0 , 1 , 1 , $ year ) ; $ wtag = ( int ) date ( 'w' , $ first ) ; if ( $ wtag <= 4 ) { /* Thursday or less: back to Monday */ $ firstmonday = mktime ( 0 , 0 , 0 , 1 , 1 - ( $ wtag - 1 ) , $ year ) ; } elseif ( $ wtag != 1 ) { /* Back to Monday */ $ firstmonday = mktime ( 0 , 0 , 0 , 1 , 1 + ( 7 - $ wtag + 1 ) , $ year ) ; } else { $ firstmonday = $ first ; } return $ firstmonday ; } $ monday = strtotime ( $ year . 'W' . static :: pad ( $ cWeek ) . '1' ) ; return $ monday ; }
Calculate the beginning of a calender week
if no calendar week is given get the beginning of the first week of the year

@param int $year (format xxxx)
@param int $cWeek (optional, defaults to first, range 1...52/53)
@return int Timestamp
Calculate the beginning of a calender week if no calendar week is given get the beginning of the first week of the year