Bug #66243 [Opn->Csd]: Strtotime producing invalid result

From: Date: Sat, 07 Dec 2013 07:30:17 +0000
Subject: Bug #66243 [Opn->Csd]: Strtotime producing invalid result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183190@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66243&edit=1 ID: 66243 User updated by: elliottpost at gmail dot com Reported by: elliottpost at gmail dot com Summary: Strtotime producing invalid result -Status: Open +Status: Closed Type: Bug Package: Date/time related Operating System: Ubuntu 12.04 PHP Version: 5.4.22 Block user comment: N Private report: N New Comment: I'm an idiot. n != day... Sorry! Previous Comments: ------------------------------------------------------------------------ [2013-12-07 07:17:58] elliottpost at gmail dot com Description: ------------ Strtotime() is producing unusual numbering whether running on a server or a fresh install on localhost without modifying php.ini. Example given in the docs is "10 September 2000". strtotime("10 September 2000") works; however, it is a day off. I thought this is due to time zone issues, but when trying the below script it produces a result of December 12, 2000. More than 24 hours off--doesn't seem possible just because of time zones. The higher you go up, the further off it gets--but some work okay. I can't explain it, but I've listed a few samples below. Test script: --------------- <?php echo date( "F n, Y", strtotime( "10 September 2000") ); //prints September 9, 2000 echo date( "F n, Y", strtotime( "10 December 2000") ); //prints December 12, 2000 echo date( "F n, Y", strtotime( "25 December 2013") ); //prints December 12, 2013 echo date( "F n, Y", strtotime( "2014-12-25") ); //prints December 12, 2013 echo date( "F n, Y", strtotime( "2014-05-05") ); //prints May 5, 2014 ?> Expected result: ---------------- I expected the time to be formatted correctly. Actual result: -------------- Please see the test-script...I've added comments by each echo statement. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66243&edit=1

« previous php.bugs (#183190) next »