Cake\Chronos\Traits\DifferenceTrait::diffInSeconds PHP Method

diffInSeconds() public method

Get the difference in seconds
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
return 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;
    }