FunctionCopy link to clipboard
local( datetime, timezone )
This is a Date and Time addition function, adding time zone offset to given Date and Time.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Date and Time |
The base Date and Time to be modified. |
|
Text or Number (Integer) |
The time zone offset to add to the datetime parameter. |
ReturnsCopy link to clipboard
Date and Time
Usage considerationsCopy link to clipboard
This function does not store the time zone offset with the returned value.
The datetime parameter accepts Date variables, Date and Time variables, and process properties such as pp!starttime.
The timezone parameter accepts four formats of input:
- Time zone IDs, such as
America/Denver
. - Time zone acronyms, such as
MST
. - Hours and minutes offset from a GMT date and time, such as
GMT-06:00
. - Minutes offset, such as
-30
.
Time zone IDs, time zone acronyms, and GMT offsets must be enclosed in quotation marks (""
). If a timezone is not passed, the time zone of the current context is used.
Passing a time zone ID (such as "Asia/Tokyo"
) causes the result to be adjusted for daylight saving time. Passing a time zone acronym (such as "GMT"
) does not cause the result to be adjusted for daylight saving time.
ExamplesCopy link to clipboard
Use a specific offsetCopy link to clipboard
Note: These examples assume the system or user time zone is Greenwich Mean Time (GMT).
Offset using a time zone IDCopy link to clipboard
1
local(datetime(2022, 11, 11, 2, 30), "Europe/Helsinki")
Copy
Returns 11/11/2022 4:30 AM GMT+00:00
. A +2 hour offset was added to the time, but the timezone was not changed from GMT.
Offset using a GMT offsetCopy link to clipboard
1
local(datetime(2022, 11, 11, 2, 30), "GMT+02:00")
Copy
Returns 11/11/2022 4:30 AM GMT+00:00
.
Offset using minutesCopy link to clipboard
1
local(datetime(2022, 11, 11, 2, 30), "120")
Copy
Returns 11/11/2022 4:30 AM GMT+00:00
.
Offset using the current contextCopy link to clipboard
1
local(datetime(2022, 11, 11, 2, 30))
Copy
Returns 11/11/2022 10:30 AM GMT+04:00
provided that the timezone of the current context is GMT+4. The GMT time of 2:30 AM is offset by +4 hours, causing the function to return Nov 11, 6:30 AM GMT. This GMT time is then displayed to the user as 10:30 AM GMT+4 in the current context.
Use local() to get the current context for date time functionsCopy link to clipboard
1
todate(local(now()))
Copy
If the current datetime is 11/10/2022 10:30 PM GMT-04:00
in the context of GMT-4, the expression above returns 11/10/2022
. Compare this to an expression without the local
function below.
1
todate(now())
Copy
Returns 11/11/2022
because todate
acts on the datetime in GMT, which is 11/11/2022 2:30 AM
. It does not act on the local datetime of 11/10/2022 10:30 PM
in GMT-4.
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 |