Time Functions
TIME
Creates a time value using separate hour, minute, and second components. The string representation of the time is in HHMMSS format. The hour is represented in 24-hour format.
Usage
TIME(hours, minutes, seconds)
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
hours |
number |
The hours component of the time (0-23) |
|
minutes |
number |
The minutes component of the time (0-59) |
|
seconds |
number |
The seconds component of the time (0-59) |
Examples
|
Formula |
Return value |
|---|---|
|
TIME(12, 12, 12) + 1 |
TIME(12, 12, 13) |
|
TIME(23, 59, 59) + 1 |
TIME(0, 0, 0) |
NOW
Returns the current local TIME value on the client machine.
Usage
NOW()
Examples
|
Formula |
Return value |
|---|---|
|
NOW() |
TIME(12, 12, 13) |
HOUR
Extracts the hour from a given TIME value or a time string in HHMMSS or HHMM format.
Usage
HOUR(timeValue)
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
timeValue |
TIME, string |
A TIME value or a time string in HHMMSS or HHMM format |
Examples
|
Formula |
Return value |
|---|---|
|
HOUR(TIME(12, 30, 45)) |
12 |
|
HOUR('123045') |
12 |
|
HOUR('2359') |
23 |
MINUTE
Extracts the minute from a given TIME value or a time string in HHMMSS or HHMM format.
Usage
MINUTE(timeValue)
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
timeValue |
TIME, string |
A TIME value or a time string in HHMMSS or HHMM format |
Examples
|
Formula |
Return value |
|---|---|
|
MINUTE(TIME(12, 30, 45)) |
30 |
|
MINUTE('123045') |
30 |
|
MINUTE('2359') |
59 |
SECOND
Extracts the second from a given TIME value or a time string in HHMMSS or HHMM format.
Usage
SECOND(timeValue)
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
timeValue |
TIME, string |
A TIME value or a time string in HHMMSS or HHMM format |
Examples
|
Formula |
Return value |
|---|---|
|
SECOND(TIME(12, 30, 45)) |
45 |
|
SECOND('123045') |
45 |
|
SECOND('2359') |
0 |