- Categories:
TIME_FROM_PARTS¶
Creates a time from individual numeric components.
- Aliases:
TIMEFROMPARTS
Syntax¶
Arguments¶
Required:
hourAn integer expression to use as an hour for building a time, usually in the 0-23 range.
minuteAn integer expression to use as a minute for building a time, usually in the 0-59 range.
secondAn integer expression to use as a second for building a time, usually in the 0-59 range.
Optional:
nanosecondsA 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.
Examples¶
Components in normal ranges:
Components outside normal ranges:
100th minute (from midnight)
12345 seconds (from noon)