note 88404 added to function.strtotime
| From: | shad at exprior dot com | Date: | Thu, 22 Jan 2009 15:23:42 +0000 |
| Subject: | note 88404 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149663@lists.php.net to get a copy of this message | ||
I'm trying to add 29 years to the current date
<?php
list($m,$d,$y) = explode('-',date('m-d-Y'));
$now = mktime(0, 0, 0, $m, $d, $y);
$expires = strtotime("+29 year",$now);
$_ = date("m-d-Y", intval($expires));
echo 'Expires on '.$_;
?>
Result is 'Expires on 01-01-1970'
The same code but with "+28 year" produces the expected rusult 'Expires on
01-22-2037'.
Where is the problem? What have I missed? (php 5.2.6)
----
Server IP: 91.196.196.205
Probable Submitter: 94.178.96.64
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/88404
Del: integrated -- https://master.php.net/note/delete/88404/integrated
Del: useless -- https://master.php.net/note/delete/88404/useless
Del: bad code -- https://master.php.net/note/delete/88404/bad+code
Del: spam -- https://master.php.net/note/delete/88404/spam
Del: non-english -- https://master.php.net/note/delete/88404/non-english
Del: in docs -- https://master.php.net/note/delete/88404/in+docs
Del: other reasons-- https://master.php.net/note/delete/88404
Reject -- https://master.php.net/note/reject/88404
Search -- https://master.php.net/manage/user-notes.php