Documentation/Calc Functions/DAYS/en

Function name:
DAYS

Category:
Date and Time

Summary:
Calculates the number of days between two dates, assuming the standard calendar.

Syntax:
DAYS(Date2; Date1)

Returns:
Returns a real number which is the difference between the two given dates in days.

Arguments:
Date1 is the date (in quotation marks) or a date-time serial number, or a reference to the cell containing one of those types, which is either the start date or the end date of the period for which the calculation is to be carried out.

Date2 is the date (in quotation marks) or a date-time serial number, or a reference to the cell containing one of those types, which is either the end date or the start date of the period for which the calculation is to be carried out.


 * If either Date1 or Date2 is not a valid date expression, then DAYS reports a #VALUE! error.
 * If Date2 is earlier than Date1, the result is a negative number; if Date2 is later than Date1, the result is a positive number.
 * Both Date1 and Date2 may include time components, for example “2020-12-08T21:30:00” or 42711.90. In such cases the value returned may include a fractional part.

Details specific to DAYS function
The formula for this function is DAYS = Date2 – Date1, subtracting the two date-time serial numbers.

This function is not identical to Microsoft Excel’s DAYS function, which does not take account of any time components of the dates.

Related LibreOffice functions:
DATEDIF

DAYS360

MONTH

YEAR

ODF standard:
Section 6.10.6, part 2

Equivalent Excel functions:
DAYS