Skip to content

Instantly share code, notes, and snippets.

@maxxscho
Created October 24, 2012 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxxscho/3946434 to your computer and use it in GitHub Desktop.
Save maxxscho/3946434 to your computer and use it in GitHub Desktop.
PHP - Get first day of a given week
$week = 43;
$timestamp = mktime(0, 0 ,0, 1, 1, $this->year) + ($week * 7 * 24 * 60 * 60);
$timestamp_for_monday = $timestamp - 86400 * ( date( 'N', $timestamp) - 1 );
$first_day_of_week = date('d.m.Y', $timestamp_for_monday);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment