Skip to content

Kirby 3.9.8

$date->nearest()

Returns the datetime which is nearest to the object's datetime

$date->nearest(DateTimeInterface|string|int ...$datetime = null): DateTimeInterface|string|int

Parameters

Name Type Default Description
... $datetime DateTimeInterface|string|int null Datetime strings, UNIX timestamps or objects

Return type

DateTimeInterface|string|int

Parent class

Kirby\Toolkit\Date