Description
The function days calculates the number of days between two given date values. It can be used to analyze time durations between events, tasks, or projects.
Syntax
days(startdate, duedate)
Arguments
| Argument | Description |
|---|---|
| startdate | The start date for the calculation. It must be a valid date. |
| duedate | The end date for the calculation. It must be a valid date. |
Return Types
The function returns the number of days as an integer. Negative values are returned if the end date is before the start date.
Examples
| Formula | Result |
|---|---|
| days("2023-01-01", "2023-01-06") | 5 |
| days("2023-12-25", "2023-12-31") | 6 |
| days("2024-05-10", "2024-05-05") | -5 |
Notes
- The function does not consider hours, minutes, or seconds – only the date is used.
- If any of the arguments are not a valid date, an error will be returned.
- The function can be used in combination with other date functions to perform dynamic calculations.
Comments
0 comments
Please sign in to leave a comment.