$date->round()
Rounds the date to the nearest value of the given unit
Parameters
Name | Type | Default | Description |
---|---|---|---|
$unit * | string |
– | year , month , day , hour , minute or second |
$size | int |
1 |
Rounding step starting at 0 of the specified unit |
Return type
This method does not modify the existing $date
object but returns a new object with the changes applied. Learn more →
Exceptions
Type | Description |
---|---|
Kirby\Exception\InvalidArgumentException |
If the unit name or size is invalid |