FunctionCopy link to clipboard
todatetime( value )
Converts a value to Date and Time with Timezone.
See also: datetime()
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Any Type |
Value to convert. |
ReturnsCopy link to clipboard
Datetime
Usage considerationsCopy link to clipboard
Using todatetime() with arraysCopy link to clipboard
When operating on arrays, it is not necessary to use apply
with todatetime
. If multiple parameters are passed, or one parameter is an Array, todatetime
will return a Datetime Array.
Date formattingCopy link to clipboard
Text will be parsed in m/d/y
and d-m-y
format to form a datetime.
Time zonesCopy link to clipboard
When datetime values are presented to users in the interface, they are localized to the current user's timezone. This can cause the expected output to vary significantly. Additionally, the acronym of the local timezone (such as EST) is appended to a displayed datetime value when it appears in a form, an alert, or in an email.
ExamplesCopy link to clipboard
Date valueCopy link to clipboard
1
todatetime(date(2005,12,13))
Copy
Returns 12/13/05 12:00 AM GMT
.
Date string with slashesCopy link to clipboard
1
todatetime("12/13/2005")
Copy
Returns 12/13/05 12:00 AM GMT
.
List of date strings with slashesCopy link to clipboard
1
2
3
4
{
todatetime("12/13/2005","12/14/2005"),
todatetime({"12/13/2005","12/14/2005"})
}
Copy
Returns {12/13/05 12:00 AM GMT,12/14/05 12:00 AM GMT,12/13/05 12:00 AM GMT,12/14/05 12:00 AM GMT}
.
List of integer valuesCopy link to clipboard
1
2
3
4
{
todatetime(0, 1, 2)
todatetime({0, 1, 2})
}
Copy
Returns 1/1/2035 12:00 AM GMT; 1/2/2035 12:00 AM GMT; 1/3/2035 12:00 AM GMT, 1/1/2035 12:00 AM GMT; 1/2/2035 12:00 AM GMT; 1/3/2035 12:00 AM GMT
.
List of date strings with slashes and dashesCopy link to clipboard
1
todatetime("10/28/2020", "28-10-2020")
Copy
Returns {10/28/2020 12:00 AM GMT
, 10/28/2020 12:00 AM GMT
}. When using dashes, the date is processed as dd-mm-yyyy
; when using slashes, the date is processed as mm/dd/yyyy
.
List of dashed date strings with invalid daysCopy link to clipboard
A day reference is invalid when the day is in the allowed range (1-31), but the day does not exist in the specified month and year. For example, February 29th is a valid day if the year is a leap year, but it is invalid otherwise. April 31st is an invalid day in any year.
If a value includes an invalid day, Appian will round to the nearest valid date.
Non-leap yearCopy link to clipboard
1
todatetime("31-02-2021", "30-02-2021", "29-02-2021", "28-02-2021")
Copy
Returns {2/28/2021 12:00 AM GMT, 2/28/2021 12:00 AM GMT, 2/28/2021 12:00 AM GMT, 2/28/2021 12:00 AM GMT}
because February 28th is the last valid day of the month in a non-leap year.
Leap yearCopy link to clipboard
1
todatetime("31-02-2020", "30-02-2020", "29-02-2020", "28-02-2020")
Copy
Returns {2/29/2020 12:00 AM GMT+00:00; 2/29/2020 12:00 AM GMT+00:00; 2/29/2020 12:00 AM GMT+00:00; 2/28/2020 12:00 AM GMT+00:00}
. The first two values are rounded to February 29th, the last valid day in a leap year.
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 | |
Process Autoscaling | Compatible |