method compare documentation in bbn\Time
Compares two dates
function($date, $comparator)
{
//check if the argument $date is an instance of this class
if ( $date instanceof $this){
$tmp = $date;
}
else {
$tmp = new \bbn\Time($date);
}
switch ( $comparator ){
case $comparator === '>':
return $this->getTime() > $tmp->getTime();
break;
case $comparator === '>=':
return $this->getTime() >= $tmp->getTime();
break;
case $comparator === '<':
return $this->getTime() < $tmp->getTime();
break;
case $comparator === '<=':
return $this->getTime() <= $tmp->getTime();
break;
case $comparator === '=':
return $this->getTime() == $tmp->getTime();
break;
}
}
Compares two dates BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions