Cake\Chronos\ChronosInterface::gt PHP Method

gt() public method

Determines if the instance is greater (after) than another
public gt ( Cake\Chronos\ChronosInterface $dt ) : boolean
$dt Cake\Chronos\ChronosInterface The instance to compare with.
return boolean
    public function gt(ChronosInterface $dt);

Usage Example

Example #1
0
 /**
  * Determines if the instance is between two others
  *
  * @param ChronosInterface $dt1 The instance to compare with.
  * @param ChronosInterface $dt2 The instance to compare with.
  * @param bool $equal Indicates if a > and < comparison should be used or <= or >=
  * @return bool
  */
 public function between(ChronosInterface $dt1, ChronosInterface $dt2, $equal = true)
 {
     if ($dt1->gt($dt2)) {
         $temp = $dt1;
         $dt1 = $dt2;
         $dt2 = $temp;
     }
     if ($equal) {
         return $this->gte($dt1) && $this->lte($dt2);
     }
     return $this->gt($dt1) && $this->lt($dt2);
 }
ChronosInterface