$date->nearest()
Returns the datetime which is nearest to the object's datetime
$date->nearest(string|int|DateTimeInterface ...$datetime): DateTimeInterface|string|int
Parameters
Name | Type | Default | Description |
---|---|---|---|
...$datetime | string orint orDateTimeInterface |
no default value | Datetime strings, UNIX timestamps or objects |
Return types
DateTimeInterface
orstring
orint
This method modifies the existing $date
object it is applied to and returns it again.