TIME_FROM_PARTS
functionsupportedCore SQL functionsCreates a time from individual numeric components.
Syntax
supportedpartialnot supportednot scored
TIME_FROM_PARTS( <hour>, <minute>, <second> [, <nanoseconds>] )
Parameters
| Name | Required | Description |
|---|---|---|
hour | required | An integer expression to use as an hour for building a time, usually in the 0-23 range. |
minute | required | An integer expression to use as a minute for building a time, usually in the 0-59 range. |
second | required | An integer expression to use as a second for building a time, usually in the 0-59 range. |
nanoseconds | optional | A 9-digit integer expression to use as a nanosecond for building a time. |
Usage notes
- TIME_FROM_PARTS is typically used to handle values in “normal” ranges (e.g. hours 0-23, minutes 0-59), but it also handles values from outside these ranges. This allows, for example, choosing the N-th minute in a day, which can be used to simplify some computations.