FunctionCopy link to clipboard
totime( value )
Converts a value to Time.
See also: time()
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Any Type |
Value to convert. |
ReturnsCopy link to clipboard
Time
Usage considerationsCopy link to clipboard
Using the value parameterCopy link to clipboard
The value parameter accepts Integer, Decimal (double precision floating point), and Datetime, and Array data types.
Using totime() with arraysCopy link to clipboard
When operating on arrays, it is not necessary to use apply
with totime
. If multiple parameters are passed, or one parameter is an Array, totime
will return a Time Array.
Understanding resultsCopy link to clipboard
To return a localized time for a user, the local()
function must be nested within the totime()
function.
For example, totime(local(pp!starttime))
returns the localized time when a given process started. Otherwise the time is returned in GMT. This is true unless the user happens to reside in the GMT timezone, then no localization is necessary.
ExamplesCopy link to clipboard
Convert a datetime to timeCopy link to clipboard
1
totime(datetime(2005,12,13,12,0,0))
Copy
Returns 12:00 PM
(GMT).
1
totime(local(datetime(2005,12,13,12,0,0)))
Copy
Returns the user's local-time equivalent of 12:00 PM GMT.
Convert minutes to timeCopy link to clipboard
1
totime(30/1440, 60/1440, 300/1440, 1439/1440)
Copy
Returns {12:30 AM; 1:00 AM; 5:00 AM; 11:59 PM}
. There are 1440 minutes in a day, so divide a number of minutes by 1440 to calculate the time.
1
totime(0.02083333, 0.04166667, 0.2083333, 0.9993056)
Copy
Returns {12:30 AM; 1:00 AM; 5:00 AM; 11:59 PM}
.
1
totime(0,1,2,-3)
Copy
Returns {12:00 AM; 12:00 AM; 12:00 AM; 12:00 AM}
because non-zero integers cannot be converted.
1
totime(1, 1/1440, { null }, null)
Copy
Returns 12:00 AM, 12:01 AM, null, null
.
Feature compatibilityCopy link to clipboard
The table below lists this function's compatibility with various features in Appian.
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Compatible | Can be used to create a custom record field that only evaluates at sync time. |
Real-Time Custom Record Fields | Incompatible | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Compatible | |
Process Events | Compatible |