isInTheFuture() public static method

Returns true if given datetime string is not now AND is in the future.
public static isInTheFuture ( string $dateString, integer | null $timezone = null ) : boolean
$dateString string Datetime string or Unix timestamp
$timezone integer | null User's timezone
return boolean True if datetime is not today AND is in the future
Exemplo n.º 1
0
 /**
  * Test IsInTheFuture
  *
  * @return void
  */
 public function testIsInTheFuture()
 {
     $testDate = date(FORMAT_DB_DATE, time() + 2 * DAY);
     $is = $this->Time->isInTheFuture($testDate);
     $this->assertTrue($is);
     $testDate = date(FORMAT_DB_DATETIME, time() - 1 * MINUTE);
     $is = $this->Time->isInTheFuture($testDate);
     $this->assertFalse($is);
 }