#46932 [Opn]: strtotime() has inconsistency between 'next Monday' and '+1 Monday'

From: Date: Tue, 23 Dec 2008 14:14:18 +0000
Subject: #46932 [Opn]: strtotime() has inconsistency between 'next Monday' and '+1 Monday'
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1660@lists.php.net to get a copy of this message
ID: 46932 Updated by: derick@php.net Reported By: for-bugs at hnw dot jp Status: Open -Bug Type: Date/time related +Bug Type: Documentation problem Operating System: any PHP Version: 5.2.8 New Comment: 5.3 does the proper behavior. Previous Comments: ------------------------------------------------------------------------ [2008-12-23 06:18:53] for-bugs at hnw dot jp Description: ------------ With PHP 5.2.8 or 5.3.0alpha3, 'next Monday' and '+1 Monday' is diffrenet. On Monday, 'next Monday' seems the same day. However, '+1 Monday' means 1 week later. 'next day' and '+1 day' performs the same behavior, so it is natural to me that 'next Monday' and '+1 Monday' is the same meanings. In addition, my GNU date command never accept '+1 Monday' and 'next Monday' on Monday means the same day. So, I cannot tell what is the right behavior. I only report inconsistency. Reproduce code: --------------- <?php var_dump(date("Y-m-d",strtotime("+1 Monday 2008-12-01"))); var_dump(date("Y-m-d",strtotime("next Monday 2008-12-01"))); Actual result: -------------- string(10) "2008-12-01" string(10) "2008-12-08" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46932&edit=1

« previous php.doc.bugs (#1660) next »