Bug #66243 [NEW]: Strtotime producing invalid result
| From: | elliottpost at gmail dot com | Date: | Sat, 07 Dec 2013 07:17:58 +0000 |
| Subject: | Bug #66243 [NEW]: Strtotime producing invalid result | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-183189@lists.php.net to get a copy of this message | ||
From: elliottpost at gmail dot com
Operating system: Ubuntu 12.04
PHP version: 5.4.22
Package: Date/time related
Bug Type: Bug
Bug description:Strtotime producing invalid result
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 bug report at https://bugs.php.net/bug.php?id=66243&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66243&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66243&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66243&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66243&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66243&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66243&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66243&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66243&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66243&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66243&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66243&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66243&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66243&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66243&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66243&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66243&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66243&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66243&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66243&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66243&r=mysqlcfg