note 70173 added to function.strtotime

From: Date: Thu, 05 Oct 2006 19:02:26 +0000
Subject: note 70173 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-118095@lists.php.net to get a copy of this message
The following produces the wrong results: <?php echo date('l, F jS Y', strtotime("third wednesday", strtotime("2006-11-01"))) . "<br>"; echo date('l, F jS Y', strtotime("third sunday", strtotime("2006-01-01"))); ?> Produces: Wednesday, November 22nd 2006 Sunday, January 22nd 2006 The problem stems from strtotime when the requested day falls on the date passed to strtotime. If you look at your calendar you will see that they should return: Wednesday, November 15th 2006 Sunday, January 15th 2006 Because the date falls on the day requested it skips that day. ---- Server IP: 66.163.161.117 Probable Submitter: 72.243.24.155 ---- Manual Page -- http://www.php.net/manual/en/function.strtotime.php Edit -- https://master.php.net/note/edit/70173 Del: integrated -- https://master.php.net/note/delete/70173/integrated Del: useless -- https://master.php.net/note/delete/70173/useless Del: bad code -- https://master.php.net/note/delete/70173/bad+code Del: spam -- https://master.php.net/note/delete/70173/spam Del: non-english -- https://master.php.net/note/delete/70173/non-english Del: in docs -- https://master.php.net/note/delete/70173/in+docs Del: other reasons-- https://master.php.net/note/delete/70173 Reject -- https://master.php.net/note/reject/70173 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#118095) next »