Skip to content

Kirby 6.0.1

$date->nearest()

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

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

Parameters

Name Type Default Description
...$datetime stringorintorDateTimeInterface no default value Datetime strings, UNIX timestamps or objects

Return types

stringorintorDateTimeInterface

Parent class

Kirby\Toolkit\Date