From: kingoleg at mail dot ru
Operating system: All
PHP version: 4.3.4
PHP Bug Type: Date/time related
Bug description: strtotime(%MySQL datetime(14)%)
Description:
------------
strtotime() do not correct work with MySQL datetime(14).
Founded in Smarty shared.make_timestamp.php:
function smarty_make_timestamp($string)
{
//Skiped
$time = strtotime($string);
//For date before 20040318000000 return -1
//After 20040318100000 return timestamp
if (is_numeric($time) && $time != -1)
return $time;
// is mysql timestamp format of YYYYMMDDHHMMSS?
if (preg_match('/^\d{14}$/', $string)) {
//Skiped
}
}
Reproduce code:
---------------
Type this code:
<?php
$t = strtotime('20040318000000');
echo $t;
echo "<br>"
$t = strtotime('20040318100000');
echo $t;
?>
Expected result:
----------------
-1
149979600
Actual result:
--------------
-1
-1
--
Edit bug report at http://bugs.php.net/?id=27634&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27634&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27634&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27634&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27634&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27634&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27634&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27634&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27634&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27634&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27634&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27634&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27634&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27634&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27634&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27634&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27634&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27634&r=float