Edit report at http://bugs.php.net/bug.php?id=53778&edit=1

 ID:                 53778
 Updated by:         [email protected]
 Reported by:        mark at atlasdesignsolutions dot com
 Summary:            strtotime returning wrong result
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            Date/time related
 Operating System:   CentOS
 PHP Version:        5.2.17
 Block user comment: N
 Private report:     N

 New Comment:

This works in PHP 5.3 with the correct format, ie:



<?php

echo date('m-d-Y', strtotime('second tuesday of February 2011'))."\n";

echo date('m-d-Y', strtotime('second tuesday of March 2011'))."\n";

echo date('m-d-Y', strtotime('second tuesday of April 2011'))."\n";

?>



Outputs:



02-08-2011

03-08-2011

04-12-2011



Closing, since this works in 5.3 and 5.2 is end of lifed.


Previous Comments:
------------------------------------------------------------------------
[2011-01-18 16:26:02] mark at atlasdesignsolutions dot com

Description:
------------
strtotime is incorrectly evaluating second Tuesday for any month that
starts on Tuesday.

Test script:
---------------
<?php



echo date('m-d-Y', strtotime('second tuesday Feburary 2011'));

echo date('m-d-Y', strtotime('second tuesday March 2011'));

// Correct Date

echo date('m-d-Y', strtotime('second tuesday April 2011'));





?>

Expected result:
----------------
02-08-2011

03-08-2011

04-12-2011

Actual result:
--------------
02-15-2011

03-15-2011

04-12-2011


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53778&edit=1

Reply via email to