Between Date Function Calls
1 Introduction
Between date function calls calculate the differences between two dates.
For a deep-dive look into working with DateTime functions, check out this video:
2 millisecondsBetween
The millisecondsBetween
function calculates the difference between the input values in milliseconds.
2.1 Input Parameters
The input parameters are described in the table below:
Value | Type |
---|---|
First date | Date and time |
Second date | Date and time |
2.2 Output
The output is described in the table below:
Value | Type |
---|---|
The difference between the two dates measured in milliseconds | Decimal |
2.3 Example
If you use the following input:
|
|
The output is:
|
|
3 secondsBetween
The secondsBetween
function calculates the difference between the input values in seconds.
3.1 Input Parameters
The input parameters are described in the table below:
Value | Type |
---|---|
First date | Date and time |
Second date | Date and time |
3.2 Output
The output is described in the table below:
Value | Type |
---|---|
The difference between the two dates measured in seconds. | Decimal |
3.3 Example
If you use the following input:
|
|
The output is:
|
|
4 minutesBetween
The minutesBetween
function calculates the difference between the input values in minutes.
4.1 Input Parameters
The input parameters are described in the table below:
Value | Type |
---|---|
First date | Date and time |
Second date | Date and time |
4.2 Output
The output is described in the table below:
Value | Type |
---|---|
The difference between the two dates measured in minutes. | Decimal |
4.3 Example
If you use the following input:
|
|
The output is:
|
|
5 hoursBetween
The hoursBetween
function calculates the difference between the input values in hours.
5.1 Input Parameters
The input parameters are described in the table below:
Value | Type |
---|---|
First date | Date and time |
Second date | Date and time |
5.2 Output
The output is described in the table below:
Value | Type |
---|---|
The difference between the two dates measured in hours. | Decimal |
5.3 Example
If you use the following input:
|
|
The output is:
|
|
6 daysBetween
The daysBetween
function calculates the difference between the input values in days.
6.1 Input Parameters
The input parameters are described in the table below:
Value | Type |
---|---|
First date | Date and time |
Second date | Date and time |
6.2 Output
The output is described in the table below:
Value | Type |
---|---|
The difference between the two dates as a positive Decimal measured in days. Time is taken into consideration, so comparing date-x 0:00 with date-x 06:00 will result in 0.25000000 . |
Positive decimal |
6.3 Example
If you use the following input:
|
|
The output is:
|
|
7 weeksBetween
The weeksBetween
function calculates the difference between the input values in weeks.
7.1 Input Parameters
The input parameters are described in the table below:
Value | Type |
---|---|
First date | Date and time |
Second date | Date and time |
7.2 Output
The output is described in the table below:
Value | Type |
---|---|
The difference between the two dates measured in weeks. | Decimal |
7.3 Example
If you use the following input:
|
|
The output results in 8 days divided by 7 days in a week:
|
|
8 calendarMonthsBetween
The calendarMonthsBetween
function calculates the difference between the input values in months. Time will be ignored. The dates are assumed to be in the end-user’s local time zone.
8.1 Input Parameters
The input parameters are described in the table below:
Value | Type |
---|---|
First date | Date and time |
Second date | Date and time |
8.2 Output
The output is described in the table below:
Value | Type |
---|---|
The difference between the two dates measured in months. | Integer/Long |
8.3 Example
If you use the following input:
|
|
The output results in the amount of months between the two dates:
|
|
9 calendarYearsBetween
The calendarYearsBetween
function calculates the difference between the input values in years. Time will be ignored. The dates are assumed to be in the end-user’s local time zone.
9.1 Input Parameters
The input parameters are described in the table below:
Value | Type |
---|---|
First date | Date and time |
Second date | Date and time |
9.2 Output
The output is described in the table below:
Value | Type |
---|---|
The difference between the two dates measured in years. | Integer/Long |
9.3 Example
If you use the following input:
|
|
The output results in the amount of years between the two dates:
|
|