Get the difference in hours using a filter closure.

@param Closure   $callback
@param Date|null $dt
@param bool      $abs      Get the absolute of the difference

@return int
543886
public function diffInHoursFiltered(Closure $callback, Date $dt = null, $abs = true)
    {
        return $this->diffFiltered(Interval::hour(), $callback, $dt, $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;
    }
1047966
public function diffInWeekdays($date = null, $absolute = true)
    {
        return $this->diffInDaysFiltered(function (CarbonInterface $date) {
            return $date->isWeekday();
        }, $date, $absolute);
    }
703917
public final void setDateDetailsCallback(Callback<DateDetailsParameter, Boolean> callback) {
        requireNonNull(callback);
        dateDetailsCallbackProperty().set(callback);
    }
96100
public static int hoursDiff(Date earlierDate, Date laterDate) {
        if (earlierDate == null || laterDate == null) {
            return 0;
        }

        return (int) ((laterDate.getTime() / HOUR_MILLIS) - (earlierDate.getTime() / HOUR_MILLIS));
    }
11119
public function diff(DateTimeBase $other, bool $absolute = false)
    {
        return $this->dateTime->diff($other->dateTime, $absolute);
    }
1185553
public function diff(self $other, $absolute = false) : DateInterval
    {
        return DateInterval::diff($this, $other, $absolute);
    }
1195977
public final function getDifferenceYears( $dt = null, bool $abs = true ) : int
   {

      $dt = $dt ?: static::Now( $this->getTimezone() );

      return (int) $this->diff( $dt, $abs )->format( '%r%y' );

   }
742791
function dob() {return dfc($this, function() {
		/** @var \DateTime|null $result */
		$result = $this->_dob();
		if (!$result && df_is_customer_attribute_required('dob')) {
			$result = new \DateTime;
			$result->setDate(1900, 1, 1);
		}
		return $result;
	});}
793294
public function floatDiffInRealSeconds($date = null, $absolute = true)
    {
        return $this->diffInRealMicroseconds($date, $absolute) / static::MICROSECONDS_PER_SECOND;
    }
1211803
public static function Diff($in = false, $out = false)
        {

            // Setting the IN timestamp
            if (is_int($in)):
                $inTime = $in; else:
                $inTime = strtotime($in);
            endif;

            // Setting the OUT timestamp
            if (is_int($out)):
                $outTime = $out; else:
                $outTime = strtotime($out);
            endif;

            // Setting the DATE for $inTime and $outTime
            $inDT = date("Y-m-d H:i:s", $inTime);
            $outDT = date("Y-m-d H:i:s", $outTime);

            // Creating the IN and OUT objects
            $inObj = new \DateTime($inDT);
            $outObj = new \DateTime($outDT);

            // Calculating the difference between dates
            $output = $inObj->diff($outObj);

            // Returning the difference
            return $output;
        }
1003417
protected function _dateDiff($start = null, $stop = null) {
		if ($start) {
			$endDate = $stop instanceof DateTime ? $stop : new DateTime($stop ? $stop : 'now');
			$startDate = $start instanceof DateTime ? $start : new DateTime($start);
			$diff = $startDate->diff($endDate)->format(Configure::read('Task.dateDiffFormat'));
			return $this->_isCli ? $diff : $this->Html->tag('span', $diff);
		} else {
			return $this->_none();
		}
	}
800473
public function diffInRealMicroseconds($date = null, $absolute = true)
    {
        /** @var CarbonInterface $date */
        $date = $this->resolveCarbon($date);
        $value = ($date->timestamp - $this->timestamp) * static::MICROSECONDS_PER_SECOND +
            $date->micro - $this->micro;

        return $absolute ? abs($value) : $value;
    }
1322667
public function diff(Date $date, $absolute = false)
	{
		return $this->datetime->diff($date->datetime, $absolute);
	}
99429
public function diffInHours(Time $dt = null, $abs = true)
        {
            return (int) ($this->diffInSeconds($dt, $abs) / self::SECONDS_PER_MINUTE / self::MINUTES_PER_HOUR);
        }
287106
public function diffInWeekendDays(Date $dt = null, $abs = true)
    {
        return $this->diffInDaysFiltered(
            function (Date $date) {
                return $date->isWeekend();
            },
            $dt,
            $abs
        );
    }
1091650
public function diffInHours(Date $dt = null, $abs = true)
    {
        return (int) ($this->diffInSeconds($dt, $abs) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR);
    }