Get the difference in seconds

@param Time  $dt
@param boolean $abs Get the absolute of the difference

@return integer
432454
public function diffInSeconds(Time $dt = null, $abs = true)
        {
            $value = (($dt === null) ? time() : $dt->getTimestamp()) - $this->getTimestamp();

            return $abs ? abs($value) : $value;
        }
105573
public function diff($time) : DateInterval
    {
        $tmp = new self($time);

        return new DateInterval(abs($this->time - $tmp->getUnixTstamp()));
    }
740302
public function diff($objcDateTime = null)
    {
        if ($this->time == null || $objcDateTime == null || $objcDateTime->time == null) {
            return false;
        }
        
        /*
         * On recopie l'objet
        */
        $d = clone $this;
        $objcDateTime_clone = clone $objcDateTime;
        
        // Test si on calcul les jours ouvr�s
        $flag_jours_ouvres = ($d->flag_jours_ouvres | $objcDateTime_clone->flag_jours_ouvres) ? true : false;
        
        $objdiff = (object)[];
        $objdiff->j = 0;
        $objdiff->jo = 0;
        $signe = 1; //Delai positif ou negatif
        
        //Si la date est la m�me
        $equal_date = $d->equals($objcDateTime_clone);
        if ($equal_date == 0) {
            $objdiff->j = 1;
            
            // Jour ouvr�
            if ($flag_jours_ouvres && $objcDateTime_clone->est_jours_ouvres()) {
                $objdiff->jo = 1;
            }
            
            return $objdiff;
        }
        
        /*
         * Inverse les dates si elles ne sont pas ordonn�es
         */
        $d_start = $d_end = null;
        if ($equal_date < 0) {
            $d_start = $d;
            $d_end = $objcDateTime_clone;
        }
        else {
            $signe = -1;
            $d_start = $objcDateTime_clone;
            $d_end = $d;
        }
        
        //On retire le flag jours ouvr�es pour que le add_days ne saute pas de jours
        $d_start->set_jours_ouvres(false);
        $d_end->set_jours_ouvres(false);
        
        while ($d_start->equals($d_end) <= 0) {
            $objdiff->j++;
            if ($flag_jours_ouvres && $d_start->est_jours_ouvres()) {
                $objdiff->jo++;
            }
            
            $d_start->add_days(1);
        }
        
        $objdiff->j *= $signe;
        $objdiff->jo *= $signe;
        
        return $objdiff;
    }
43218
public function diffInWeeks(Time $dt = null, $abs = true)
        {
            return (int) ($this->diffInDays($dt, $abs) / self::DAYS_PER_WEEK);
        }
642809
public function diffInHours($date = null, $absolute = true)
    {
        return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR);
    }
631500
public function diff($datetime, $absolute = false)
    {
        if ($datetime instanceof DateTime) {
            return $this->dateTime->diff($datetime->toGregorian(), $absolute);
        }

        return $this->dateTime->diff($datetime, $absolute);
    }
86501
public function getDuration($from = Timer::START, $to = Timer::STOP) {
        $from = $this->getCheckpoint($from);
        $to = $this->getCheckpoint($to);

        if ($from === null) {
            return 0;
        }

        if ($to === null) {
            $to = microtime(true);
        }

        return abs($to - $from);
    }
919170
public function floatDiffInSeconds($date = null, $absolute = true)
    {
        return $this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_SECOND;
    }
1067218
private function isLessThan1Hour29Mins59Seconds($timeDifference)
    {
        return $timeDifference >= (($this->secondsPerMinute * 44) + 30)
            &&
            $timeDifference <= ($this->secondsPerHour + ($this->secondsPerMinute * 29) + 59);
    }
399294
public function floatDiffInMinutes($date = null, $absolute = true)
    {
        return $this->floatDiffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE;
    }
1325756
def diff(self, dt=None, abs=True):
        
        if dt is None:
            dt = self.now(self.tz)

        return Period(self, dt, absolute=abs)
927548
public function diffInSeconds($date = null, $absolute = true)
    {
        $diff = $this->diff($this->resolveCarbon($date));
        $value = $diff->days * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE +
            $diff->h * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE +
            $diff->i * static::SECONDS_PER_MINUTE +
            $diff->s;

        return $absolute || !$diff->invert ? $value : -$value;
    }
398432
public function diffInRealMinutes($date = null, $absolute = true)
    {
        return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE);
    }
202544
public function min(DateTime $dt = null)
    {
        $dt = $dt ?: static::now($this->timezone());

        return $this->lt($dt) ? $this : $dt;
    }
1164150
public function min(ChronosInterface $dt = null)
    {
        $dt = ($dt === null) ? static::now($this->tz) : $dt;

        return $this->lt($dt) ? $this : $dt;
    }
564379
public function secondsBetween(TimeOfDay $other) : int
    {
        return abs($this->dateTime->getTimestamp() - $other->dateTime->getTimestamp());
    }
663866
public static function timeDifferent($time1, $time2)
    {
        $intTime1 = $this->unixTime($time1);
        $intTime2 = $this->unixTime($time2);
        $timeDiff = $intTime2 - $intTime1;

        return $timeDiff;
    }