$date->compare()
Returns the interval between the provided and the object's datetime
$date->compare(string|int|\DateTimeInterface $datetime = 'now', DateTimeZone $timezone = null): DateInterval
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $datetime | string|int|DateTimeInterface |
'now' |
|
| $timezone | DateTimeZone |
null |
Optional default timezone if $datetime is string |
Return type
DateInterval