note 51442 added to function.date

From: Date: Thu, 31 Mar 2005 00:57:40 +0000
Subject: note 51442 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-87222@lists.php.net to get a copy of this message
@date who wrote on 30-Mar-2005 08:11 "However, if I change date("d") to 1, the results are correct. I think this is perhaps a small bug in the computation of the time in the mktime( )." That's no bug there exists no februari 30. Your code is lacking all over the place. This shouldn't be a user contributed note. @redsolution at web dot de who wrote on 28-Mar-2005 08:48 As show above in the function description you may use date('w'): <php $day = date('w'); $firstday = time(); if ($day > 0 && $day < 7) { $firstday -= ($day*86400); } $lastday = $firstday+(6*86400); ?> However this doesn't check for DST look below at my note. ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51442 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51442&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51442&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51442&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51442&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51442&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51442&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#87222) next »