|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-31 20:11 UTC] derick@php.net
[2008-11-07 13:14 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Jun 12 02:00:01 2026 UTC |
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