# Section 56. Work with Dates and Times

### 56. Work with Dates and Times

BEFORE YOU BEGIN

42 Enter Simple Data into a Spreadsheet

53 Enter Calc Functions

60 Format Cells

Calc supports almost every national and international date and time format. Calc converts date and time values that you type to a special internal number that represents the number of days since midnight January 1, 1900. Although this strange internal date representation of days since 1-1-1900 might not make sense at first, you'll use these values to compute time between two or more dates. You can easily determine how many days an account is past due, for example, by subtracting the current date from the cell in the worksheet that contains the due date.

If you enter a date in a longer format, such as July 4, 1776 , Calc usually converts the date to another format (such as 7/4/76 18:15 ). You can enter a date, a time value, or both. You can format the date and time values you enter (see 60 Format Cells ) to take on any format you wish.

TIP

The date and time functions are useful for calculating durations for past due and other calculations related to date and time values.

Eastersunday() returns the date of Easter given the year of its argument. You can add to or subtract from Eastersunday() to get the days around the holiday, such as Good Friday, which displays for any year with the following calculation: =Eastersunday(yearCell) - 2 .

Second() returns the second number of its time argument. Minute() returns the minute number of its time argument, and Hour () returns the hour number of its time argument.

TIP

You can enter a time value, a date value, or both. If you don't enter a date with a time value, Calc displays only the time in the cell.

Days() requires two date arguments and returns the number of days (and partial days) between two dates. Therefore, to determine the number of days between today and Easter, you could enter the following:

=Days(Eastersunday(Year); Now())

Although at first glance this appears convoluted, it's a simple set of arguments.

Sams Teach Yourself OpenOffice.org 2, Firefox and Thunderbird for Windows All in One
ISBN: 0672328089
EAN: 2147483647
Year: 2005
Pages: 232
Authors: Greg Perry