Skip to content

Kirby 4.2.0

$date->isBefore()

Checks if the object's datetime is before the given datetime

$date->isBefore(DateTimeInterface|string|int $datetime = 'now', ?DateTimeZone $timezone = null): bool

Parameters

Name Type Default Description
$datetime DateTimeInterface|string|int 'now'
$timezone DateTimeZone|null null Optional default timezone if $datetime is string

Return type

bool

Parent class

Kirby\Toolkit\Date