Skip to content

Kirby 5.0.4

$date->compare()

Returns the interval between the provided and the object's datetime

$date->compare(DateTimeInterface|string|int $datetime = 'now', DateTimeZone|null $timezone = null): DateInterval

Parameters

Name Type Default Description
$datetime DateTimeInterfaceorstringorint 'now'
$timezone DateTimeZoneornull null Optional default timezone if $datetime is string

Return type

DateInterval

This method modifies the existing $date object it is applied to and returns it again.

Parent class

Kirby\Toolkit\Date