public diffInSeconds ( Cake\Chronos\ChronosInterface $dt = null, boolean $abs = true ) : integer | ||
$dt | Cake\Chronos\ChronosInterface | The instance to difference from. |
$abs | boolean | Get the absolute of the difference |
Résultat | integer |
public function diffInSeconds(ChronosInterface $dt = null, $abs = true)
{
$dt = $dt === null ? static::now($this->tz) : $dt;
$value = $dt->getTimestamp() - $this->getTimestamp();
return $abs ? abs($value) : $value;
}