truncate

Truncates the duration to the specified unit.

Truncating the duration removes any time units smaller than the specified unit and returns a new Duration with the truncated value.

Parameters

unit

The duration unit to truncate to.