lowerBin
lowerBin returns a date-time value, which is at the starting (lower) end of a time range defined by the interval. For example, calculating the lower bin of a time given a 15-minute interval value would return the date-time value for the start of the fifteen-minute window (00-15, 15-30, 30-45, 45-60) that contains the input date-time.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| instant | Instant | The date-time for which to evaluate the start of the containing window. |
| dateTime | ZonedDateTime | The date-time for which to evaluate the start of the containing window. |
| intervalNanos | long | The time interval represented as nanoseconds. If this parameter is used, the offset parameter must also be in nanoseconds. |
| interval | Duration | The time interval represented as a Duration. If this parameter is used, the offset parameter must also be a Duration. |
| offset | long | The window start offset in nanoseconds. For example, a value of MINUTE would offset all windows by one minute. |
| offset | Duration | The window start offset as a Duration. For example, a value of "PT1M" would offset all windows by one minute. |
Returns
A date-time representing the start of the window.
Example
The following example converts a date-time to the lower end of a 15-minute interval. Output is shown for no offset, and an offset of 2 minutes.