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.
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. |
Date and Time
The value is converted to GMT when stored.
Note: These examples assume the system or user time zone is Greenwich Mean Time (GMT).
1
datetime(2011, 2, 28, 12, 0, 0)
Returns 2/28/2011 12:00 PM GMT+00:00
.
1
datetime(2009, 7, { 5 }, 7, 1, 20)
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 }
)
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)
Returns {}
. A value must be passed for all arguments in order to receive a valid output.
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 |
1
datetime(2022, 10, 9, 26, 63, 61, 1002)
Returns 10/9/2022 3:04 AM GMT+00:00
.
1
datetime(2022, 10, 9, 12, -60, 0)
Returns 10/9/2022 11:00 AM GMT+00:00
.
1
datetime(2022, 10, 9, -25, 0, 0)
Returns 10/9/2022 11:00 PM GMT+00:00
.
1
datetime(2022, 10, 9, {hours: 10}.hours, 0, 0)
Returns 10/9/2022 10:00 AM GMT+00:00
.
1
datetime(2022, 10, 9, a!map(hours: 10).hours, 0, 0)
Returns 10/9/2022 10:00 AM GMT+00:00
.
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
)
)
Returns 10/24/2022 11:59 PM GMT+00:00
by adding the time 11:59 PM to the date given in local!date
.
date()
will throw an error when used in datetime()
.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 |
datetime() Function