Documentation/Calc Functions/DATE

Function name:
DATE

Category:
Date and Time

Summary:
Calculates the date (as a date-time serial number) for the given year, month, and day of the month values.

Syntax:
DATE(Year; Month; Day)

Returns:
Returns an integer value which is the date-time serial number calculated using the given arguments. The returned value is formatted as a date by default, but you can apply other formats as needed.

Arguments:
Year is a non-negative integer value or a reference to a cell containing that value, which is the year to be used. Values in the range 0 to 99 are converted to four-digit years in accordance with the Year (Two Digits) setting on the dialog. However, to avoid confusion it is better to always use four-digit years.

Month is an integer value or a reference to a cell containing that value, which is the month to be used. Both positive and negative values are accepted; values outside the normal range of 1 to 12 result in carryover to the calculated year value.

Day is an integer value or a reference to a cell containing that value, which is the day to be used. Both positive and negative values are accepted; values outside the normal range (1 to 31, dependent on month) result in carryover to the calculated month value.


 * If any of Year, Month, or Day is non-numeric, then DATE reports a #VALUE! error.
 * If any of Year, Month, or Day is a non-integer value, then DATE truncates it to an integer.
 * If no value is provided for the Year argument (for example, ), then DATE reports a missing variable error (Err:511). If no value is provided for either the Month or the Day argument (for example,  ), then DATE applies a default value of 0.
 * If the value of the Year argument is negative, then DATE reports an invalid argument error (Err:502).
 * If DATE calculates a date-time serial number that corresponds to a date prior to 1582-10-15 (before the Gregorian calendar was introduced), DATE reports a #VALUE! error.
 * ODF 1.2 requires that DATE accept year values up to and including 9956. Calc’s implementation will process year values larger than this limit.

Related LibreOffice functions:
TIME

DATEVALUE

ODF standard:
Section 6.10.2, part 2

Equivalent Excel functions:
DATE