note 80018 added to function.time
| From: | miguelangeldavila at yahoo dot com dot mx | Date: | Mon, 24 Dec 2007 17:50:14 +0000 |
| Subject: | note 80018 added to function.time | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-133980@lists.php.net to get a copy of this message | ||
PHP is affected by the Y2K38 bug.
<?php
$current_time = time();
$years_from_now = 50;
$remaining_seconds = 60 * 60 * 24 * 365 * $years_from_now;
$future_unix_time = $current_time + $remaining_seconds;
$future_date = date('Y-m-d', $future_unix_time);
echo $future_date;
// 1921-11-05
?>
It is caused because the PHP uses the C 32 bits time function
----
Server IP: 148.206.80.9
Probable Submitter: 201.149.7.58
----
Manual Page -- http://www.php.net/manual/en/function.time.php
Edit -- https://master.php.net/note/edit/80018
Del: integrated -- https://master.php.net/note/delete/80018/integrated
Del: useless -- https://master.php.net/note/delete/80018/useless
Del: bad code -- https://master.php.net/note/delete/80018/bad+code
Del: spam -- https://master.php.net/note/delete/80018/spam
Del: non-english -- https://master.php.net/note/delete/80018/non-english
Del: in docs -- https://master.php.net/note/delete/80018/in+docs
Del: other reasons-- https://master.php.net/note/delete/80018
Reject -- https://master.php.net/note/reject/80018
Search -- https://master.php.net/manage/user-notes.php