Overview
Syntax | DATESUBDATE(Date1,Date2,Op) | Returns the time interval between two dates. |
Parameter 1 | Date1 | The Date1 and Date2 parameters specify the two dates to be entered. If the value of Date1 is earlier than that of Date2, a negative value is returned. If the value of Date1 is later than that of Date2, a positive value is returned. If the values of Date1 and Date2 are of the numeric types, the serial number logic of the 1990 date system will be followed. For example, the serial number 35796 represents January 1, 1998. ![]() |
Parameter 2 | Date2 | |
Parameter 3 | Op | The Op parameter specifies the time unit of the returned value. The options for the unit include s/S (second), m/M (minute), h/H (hour), d/D (day), and w/W (week). |
Notes
For the extracted data, the function supports three parameters, among which the first two are of the date or text types and the third is of the text type as required. The third parameter is case-insensitive and can be s/S, m/M, h/H, d/D, or w/W.
For the real-time data, the function supports three parameters, among which the first two are of the date or text type and the third is of the text type.
Example One
Formula | Result | Note |
---|---|---|
DATESUBDATE("2008-08-08","2008-06-06","h") | 1512 | |
DATESUBDATE("2008-06-06","2008-08-08","H") | –1512 |
Example Two
You want to calculate the time interval between two date fields, for example, the time interval between the Registration Time and Contract Signing Time fields. Click the xxx icon, click Add Calculation Field, and enter DATESUBDATE(Registration Time,Contract Signing Time,"D") to calculate the time interval between the two date fields, as shown in the following figure.