#35558 [NEW]: mktime interpreting 3 digit differently
| From: | marcel at daxy dot net | Date: | Mon, 05 Dec 2005 16:17:43 +0000 |
| Subject: | #35558 [NEW]: mktime interpreting 3 digit differently | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-89766@lists.php.net to get a copy of this message | ||
From: marcel at daxy dot net
Operating system: Linux 2.6.9
PHP version: 5.1.1
PHP Bug Type: Date/time related
Bug description: mktime interpreting 3 digit differently
Description:
------------
localtime returns years after 1900, so for 2005 it's 105.
When using this number back into mktime it returns FALSE with 5.1.1. When
using 5.0.x it returns the correct value. Try running the code at
"Reproduce code" with both 5.1 and 5.0.
This is expected behavior, but due to backwards compatibility it would be
nice to have this interpreted differently.
Reproduce code:
---------------
<?
$ltime = localtime(time(), true);
print mktime (0,0,0,0,0,$ltime['tm_year']);
?>
Expected result:
----------------
Because of the behavior of localtime it would be nice to have the correct
value returned with mktime
--
Edit bug report at http://bugs.php.net/?id=35558&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35558&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35558&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35558&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35558&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35558&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35558&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35558&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35558&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35558&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35558&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35558&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35558&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35558&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35558&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35558&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35558&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35558&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35558&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35558&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35558&r=mysqlcfg