#44005 [NEW]: mktime invalid return value

From: Date: Thu, 31 Jan 2008 19:31:08 +0000
Subject: #44005 [NEW]: mktime invalid return value
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-492@lists.php.net to get a copy of this message
From: felixl at densi dot com Operating system: win XP SP2 PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: mktime invalid return value Description: ------------ The doc of mktime says this: 'Before PHP 5.1.0, negative timestamps were not supported under any known version of Windows and some other systems as well. Therefore the range of valid years was limited to 1970 through 2038.' This text also means this: php version higher then 5.1.0 can have a greater range then 1970 through 2038. Also, in the doc: 'The number of the year, may be a two or four digit value, with values between 0-69 mapping to 2000-2069 and 70-100 to 1970-2000. On systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038. However, before PHP 5.1.0 this range was limited from 1970 to 2038 on some systems (e.g. Windows).' Which clearly specify that date as high as 2069 are possible. Strange because a date in 2050 doesn't work. 2 possibles solution: - correct the bug - change the doc Reproduce code: --------------- $year = 2050; $month = 10; $day = 17; $hour = 10; $min = 32; $sec = 0; $valid = mktime($hour, $min, $sec, $month, $day, $year); print $valid; Expected result: ---------------- a valid timestamp Actual result: -------------- false -- Edit bug report at http://bugs.php.net/?id=44005&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=44005&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44005&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44005&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44005&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44005&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44005&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44005&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44005&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44005&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44005&r=support Expected behavior: http://bugs.php.net/fix.php?id=44005&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44005&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44005&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44005&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=44005&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=44005&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44005&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44005&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44005&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44005&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44005&r=mysqlcfg

« previous php.doc.bugs (#492) next »