note 107102 deleted from function.date by tularis

From: Date: Thu, 09 Feb 2012 20:48:20 +0000
Subject: note 107102 deleted from function.date by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-185946@lists.php.net to get a copy of this message
Note Submitter: raotallinn dot ee at gmail dot com ---- 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; } } ?>

« previous php.notes (#185946) next »