note 20570 deleted from function.strtotime by sniper

From: Date: Tue, 21 Oct 2003 11:04:59 +0000
Subject: note 20570 deleted from function.strtotime by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59021@lists.php.net to get a copy of this message
Note Submitter: nospam@domain.com ---- To find the first day of the week (e.g.: Sunday) for any given week, try this function. function sundayOfWeek($year,$month,$day) { $linkDay = "$month/$day/$year"; $w = date("w", strtotime("$linkDay")); $sow = date("Y-m-d", (strtotime("$linkDay")-$w*82800)); return $sow; } NOTE: In order to account for Daylight Savings Time (loosing or gaining an hour) I use 82800 seconds instead of 86400 (60*60*7).

« previous php.notes (#59021) next »