class DataBase public static time false public function remainingTime

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
class DataBase{
public static $time = false;
public function remainingTime() {
$d1 = new DateTime('now');
$d2 = new DateTime('2014-11-15 10:00:00');
$int = $d1->diff($d2);
echo $int->s;
if($int->s == 0) self::$time = true;
}
}
$PDO = new DataBase();
if(!$PDO::$time) $PDO->remainingTime();
else exit;