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