DAYS
The function DAYS takes either two DateTimes or two Dates, and returns the number of days between them.
This function takes two pieces of input: either two Dates or two DateTimes. It outputs a Number: the number of days between the two DateTimes.
Declaration
Parameters
datetime1 (type: DateTime)
Any DateTime.
datetime2 (type: DateTime)
Any DateTime.
date1 (type: Date)
Any Date.
date2 (type: Date)
Any Date.
Return Values
days (type: Number)
The number of days between two dates.
Examples
Assume the first two examples have access to the following DateTime values:
The following example outputs the number of days between example_date_and_time1 and example_date_and_time2:
The DAYS function returns the absolutely number of days between the two given dates; it doesn't matter what order they are given. The following example outputs the number of days between example_date_and_time2 and example_date_and_time1; note that this output is exactly the same as in the above example.
The previous examples showcased how the DAYS function behaves when given DateTimes as input. To demonstrate how it behaves when given Dates, assume the last example has access to the following Date values:
The following outputs the number of days between example_date1 and example_date2. Note that the dates described by these Dates is the same as the dates described by the DateTimes given above, and so the output is exactly the same:
Last updated