ToTime Function
ToTime Function
Use ToTime to convert values from a different data type to a time value.
ToTime supports the following data types:
- number
- text
- time
Description 1 of 4 (convert a number value):
Convert the decimal part of a number value to a time value.
The decimal part, obtained by the function
Mod(
, represents a fraction of a 24-hour day. value
, 1 )Returns:
Time
Parameter:
Parameter | Data Type | Description |
|---|---|---|
1 | Number | The number to be converted. |
Examples:
When using functions inside a field, remember the field brackets:
{ToTime(VariableName)}
Expression | Result |
|---|---|
ToTime( 0 ) | Time( 0, 0, 0 ) |
ToTime( 1.5 ) | Time( 12, 0, 0 ) |
ToTime( 99999.999988425925926 ) | Time( 23, 59, 59 ) |
Description 2 of 4 (convert a text value):
Convert a text value to a time value.
The text value must be one of the forms:
- "hh:mm:ss"
- "hh:mm"
- "hh"
note
This function is non-evaluable if the text value does not correspond to a time.
Returns:
Time
Parameter:
Parameter | Data Type | Description |
|---|---|---|
1 | Text | The text to be converted. |
Examples:
When using functions inside a field, remember the field brackets:
{ToTime(VariableName)}
Expression | Result |
|---|---|
ToTime( "23:5:45" ) | Time( 23, 5, 45 ) |
ToTime( "23:5" ) | Time( 23, 5, 0 ) |
ToTime( "23" ) | Time( 23, 0, 0 ) |
Description 3 of 4 (convert a list of number values):
Convert the decimal part of a list of number values to a list of time values.
The decimal part, obtained by the function
Mod(
, represents a fraction of a 24-hour day. value
, 1 )Returns:
Time*
Parameter:
Parameter | Data Type | Description |
|---|---|---|
1 | Number* | The list of number values to be converted. |
Examples:
When using functions inside a field, remember the field brackets:
{ToTime(VariableName)}
Expression | Result |
|---|---|
ToTime( List(0, 1.5, 99999.999988425925926) ) | List(Time( 0, 0, 0 ), Time( 12, 0, 0 ), Time( 23, 59, 59 )) |
Description 4 of 4 (convert a list of text values):
Convert a list of text values to a list of time values.
The text value must be one of the forms:
- "hh:mm:ss"
- "hh:mm"
- "hh"
note
This function is non-evaluable if any of the text values do not correspond to a time.
Returns:
Time*
Parameter:
Parameter | Data Type | Description |
|---|---|---|
1 | Text* | The list of text values to be converted. |
Examples:
When using functions inside a field, remember the field brackets:
{ToTime(VariableName)}
Expression | Result |
|---|---|
ToTime( List("23:5:45", "23:5", "23") ) | List(Time( 23, 5, 45 ), Time( 23, 5, 0 ), Time( 23, 0, 0 )) |