Calc Guide

Date and time functions
Use these functions for inserting, editing, and manipulating dates and times.
OpenOffice.org handles and computes a date/time value as a number. When you
assign the number format “Number” to a date or time value, it is displayed as a
number. For example, 01/01/2000 12:00 PM, converts to 36526.5. This is just a
matter of formatting; the actual value is always stored and manipulated as a number.
To see the date or time displayed in a standard format, change the number format
(date or time) accordingly.
To set the default date format used by Calc. go to Tools > Options >
OpenOffice.org Calc > Calculate.
Caution
When entering dates, slashes or dashes used as date separators may be
interpreted as arithmetic operators. To keep dates from being
interpreted as parts of formulas, and thus returning erroneous results,
always place them in quotation marks, for example, "12/08/52".
Table 38: Data and time functions
Syntax Description
DATE(year; month; day) Converts a date written as year, month, day to an
internal serial number and displays it in the cell’s
formatting. Year is an integer between 1583 and
9956 or 0 and 99. Month is an integer between 1
and 12. Day is an integer between 1 and 31.
DATEVALUE("Text") Returns the internal date number for text in quotes.
Text is a valid date expression and must be entered
with quotation marks.
DAY(number) Returns the day, as an integer, of the given date
value. A negative date/time value can be entered.
Number is a time value.
DAYS(date_2; date_1) Calculates the difference, in days, between two date
values. Date_1 is the start date. Date_2 is the end
date. If Date_2 is an earlier date than Date_1, the
result is a negative number.
DAYS360(date_1; date_2;
type)
Returns the difference between two dates based on
the 360 day year used in interest calculations. If
Date_2 is earlier than Date_1, the function will
return a negative number. Type (optional)
determines the type of difference calculation: the US
method (0) or the European method (≠0).
DAYSINMONTH(date) Calculates the number of days in the month of the
given date.
DAYSINYEAR(date) Calculates the number of days in the year of the
given date.
EASTERSUNDAY(integer) Returns the date of Easter Sunday for the entered
year. Year is an integer between 1583 and 9956 or 0
and 99.
Appendix B Description of Functions 401