Number of input and output field
| Number of input field |
: |
Two |
| Number of output field |
: |
One |
This transformation function is used to calculate the difference between two dates (date
1 and date
2). The result is a double value representing the number of days between date
1 and date
2.
- If date1 and date2 are provided in timestamp format (milliseconds since midnight, January 1, 1970 UTC), the Diff function does not require any parameters.
- If the dates are not in timestamp format, the Diff function requires a date-format parameter, which is used to convert date1 and date2 into timestamp representations.
- If date1 is earlier than date2, the result will be a negative number.
- If date1 is later than date2, the result will be a positive number.