note 108317 added to datetime.formats.relative

From: Date: Tue, 17 Apr 2012 08:25:57 +0000
Subject: note 108317 added to datetime.formats.relative
Groups: php.notes 
Request: Send a blank email to php-notes+get-187198@lists.php.net to get a copy of this message
April 1st, 2012 is Sunday. You might expect to get April 2nd, 2012 with 'Monday next week', however this: <?php echo date('F jS, Y', strtotime('Monday next week 2012-04-01')); ?> returns April 9th, 2012. To get April 2nd, you need to use this: <?php echo date('F jS, Y', strtotime('next Monday 2012-04-01')); ?> Apparently 'next week' advances the week if and only if the day is Sunday. This: <?php echo date('F jS, Y', strtotime('Monday next week 2012-03-31')); ?> would still return April 2nd. ---- Server IP: 95.130.168.26 Probable Submitter: 95.9.177.225 ---- Manual Page -- http://www.php.net/manual/en/datetime.formats.relative.php Edit -- https://master.php.net/note/edit/108317 Del: integrated -- https://master.php.net/note/delete/108317/integrated Del: useless -- https://master.php.net/note/delete/108317/useless Del: bad code -- https://master.php.net/note/delete/108317/bad+code Del: spam -- https://master.php.net/note/delete/108317/spam Del: non-english -- https://master.php.net/note/delete/108317/non-english Del: in docs -- https://master.php.net/note/delete/108317/in+docs Del: other reasons-- https://master.php.net/note/delete/108317 Reject -- https://master.php.net/note/reject/108317 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#187198) next »