$date->nearest()
Returns the datetime which is nearest to the object's datetime
Parameters
Name | Type | Default | Description |
---|---|---|---|
$datetime | string |int |DateTimeInterface |
null |
Datetime strings, UNIX timestamps or objects |
Return type
string
|int
|DateTimeInterface