time() subtraction
Posted: Sun Jul 25, 2004 6:34 pm
Would this be the best way to determine if one date is 3 or more days older than today?
The way the dates are inserted into the database is by the time() function, so this is the first thing I've put together and tested to check, but I was wondering if this would be sufficient or if there was something else I should do....
Code: Select all
$time = "1090492366";
echo date("n/j/y H:i:s",$time-date("Z"))."<br>";
echo date("n/j/y H:i:s",time()-date("Z"))."<br>";
$startTime= date("ynjHis",$time-date("Z"));
$today = date("ynjHis",time()-date("Z"));
if($today - $startTime>= 3000000){
echo "over 3 days old";
}