note 107102 added to function.date
| From: | raotallinn dot ee at gmail dot com | Date: | Sat, 07 Jan 2012 12:46:46 +0000 |
| Subject: | note 107102 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185447@lists.php.net to get a copy of this message | ||
My code to check, whether the time between present and a specified time in number of seconds since
Unix Epoch is bigger then specified number of days.
Examples
<?php
//time() is 604800, that is 7 days since Unix Epoch
timecheck(0, 6) //Returns TRUE
?>
<?php
//time() is 604800, that is 7 days since Unix Epoch
timecheck(0, 8) //Returns FALSE
?>
<?php
timecheck($date, $days)
{
$seconds = $days * 24 * 60 * 60;
$deadline = $date + $seconds;
if(time > deadline)
{
return TRUE;
}
else
{
return FALSE;
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 88.196.138.159
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/107102
Del: integrated -- https://master.php.net/note/delete/107102/integrated
Del: useless -- https://master.php.net/note/delete/107102/useless
Del: bad code -- https://master.php.net/note/delete/107102/bad+code
Del: spam -- https://master.php.net/note/delete/107102/spam
Del: non-english -- https://master.php.net/note/delete/107102/non-english
Del: in docs -- https://master.php.net/note/delete/107102/in+docs
Del: other reasons-- https://master.php.net/note/delete/107102
Reject -- https://master.php.net/note/reject/107102
Search -- https://master.php.net/manage/user-notes.php