Bug #67354 [NEW]: Invalid year parse

From: Date: Wed, 28 May 2014 18:14:50 +0000
Subject: Bug #67354 [NEW]: Invalid year parse
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185956@lists.php.net to get a copy of this message
From: dr dot hab dot freek at gmail dot com Operating system: Debian PHP version: 5.4.28 Package: *Data Exchange functions Bug Type: Bug Bug description:Invalid year parse Description: ------------ So - we see in manual strtotime() should working great with all formats from http://www.php.net/manual/en/datetime.formats.php so if we run: date('Y-m-d H:i:s', strtotime('2008')); //return current date with the wrong time - 2014-05-28 20:08:00 So we can't use strtotime(date('Y')) so we should add month: strtotime(date('Y-m')) - then it works. Test script: --------------- date('Y-m-d H:i:s', strtotime('2008')); Expected result: ---------------- 2008-01-01 00:00:00 Actual result: -------------- 2014-05-28 20:08:00 //invalid date with modified time -- Edit bug report at https://bugs.php.net/bug.php?id=67354&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67354&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67354&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67354&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67354&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67354&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67354&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67354&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67354&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67354&r=support Expected behavior: https://bugs.php.net/fix.php?id=67354&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67354&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67354&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67354&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67354&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67354&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67354&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67354&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67354&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67354&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67354&r=mysqlcfg

« previous php.bugs (#185956) next »