Created
October 24, 2012 14:37
-
-
Save maxxscho/3946434 to your computer and use it in GitHub Desktop.
PHP - Get first day of a given week
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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