FunctionCopy link to clipboard
datetime( year, month, day, hour, minute, second )
Converts the given Date and Time into a serial number that holds the Date and Time data type.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Integer |
The year of the you would like to convert into a serial number. |
|
Integer |
Only numbers are accepted, not month names. Do not include leading zeroes for a month with one digit. |
|
Integer |
The day of the Date and Time. |
|
Integer |
The hour of the Date and Time. |
|
Integer |
The minute of the Date and Time. |
|
Integer |
The seconds of the Date and Time. |
ReturnsCopy link to clipboard
Date and Time
Usage considerationsCopy link to clipboard
The value is converted to GMT when stored.
ExamplesCopy link to clipboard
Note: These examples assume the system or user time zone is Greenwich Mean Time (GMT).
1
datetime(2011, 2, 28, 12, 0, 0)
Copy
Returns 2/28/2011 12:00 PM GMT+00:00
.
1
datetime(2009, 7, { 5 }, 7, 1, 20)
Copy
Returns 7/5/2009 7:01 AM GMT+00:00
.
1
2
3
4
5
6
7
8
datetime(
{ 2009, 2008 },
{ 7, 4 },
{ 5, 10 },
{ 12, 10 },
{ 2, 20 },
{ 0, 0 }
)
Copy
Returns {7/5/2009 12:02 PM GMT+00:00, 4/10/2008 10:20 AM GMT+00:00}
. All lists must be the same length.
1
datetime(2009, 7, 9, {}, 2, 0)
Copy
Returns {}
. A value must be passed for all arguments in order to receive a valid output.
Out-of-range time valuesCopy link to clipboard
Each of the time parameters has a normal range of values. You can use positive or negative values outside the normal range for any of these parameters.
Parameter | Range |
---|---|
hour | 0–24 |
minute | 0–60 |
second | 0–60 |
millisecond | 0–999 |
Positive out-of-range valuesCopy link to clipboard
1
datetime(2022, 10, 9, 26, 63, 61, 1002)
Copy
Returns 10/9/2022 3:04 AM GMT+00:00
.
Negative out-of-range valuesCopy link to clipboard
1
datetime(2022, 10, 9, 12, -60, 0)
Copy
Returns 10/9/2022 11:00 AM GMT+00:00
.
1
datetime(2022, 10, 9, -25, 0, 0)
Copy
Returns 10/9/2022 11:00 PM GMT+00:00
.
Dictionaries and mapsCopy link to clipboard
1
datetime(2022, 10, 9, {hours: 10}.hours, 0, 0)
Copy
Returns 10/9/2022 10:00 AM GMT+00:00
.
1
datetime(2022, 10, 9, a!map(hours: 10).hours, 0, 0)
Copy
Returns 10/9/2022 10:00 AM GMT+00:00
.
Append a time to a dateCopy link to clipboard
1
2
3
4
5
6
7
8
9
10
11
a!localVariables(
local!date: date(2022, 10, 24),
datetime(
year(local!date),
month(local!date),
day(local!date),
23,
59,
00
)
)
Copy
Returns 10/24/2022 11:59 PM GMT+00:00
by adding the time 11:59 PM to the date given in local!date
.
See alsoCopy link to clipboard
- date(): Limitations on year also apply to Date and Time. Dates that return null in
date()
will throw an error when used indatetime()
. - userdatetime(): Use this function to return a Datetime value in the local time zone.
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 |