Beregninger med dato og klokkeslett

I LibreOffice Calc kan du utføre beregninger med nåværende dato og klokkeslett. For eksempel kan du finne ut hvor gammel du er i sekunder eller timer ved å gjøre følgende:

  1. Skriv inn fødselsdagen din i celle A1 i et regneark.

  2. Enter the following formula in cell A3: =NOW()-A1

  3. After pressing the Enter key you will see the result in date format. Since the result should show the difference between two dates as a number of days, you must format cell A3 as a number.

  4. Place the cursor in cell A3, right-click to open a context menu and choose Format Cells.

  5. The Format Cells dialog appears. On the Numbers tab, the "Number" category will appear already highlighted. The format is set to "General", which causes the result of a calculation containing date entries to be displayed as a date. To display the result as a number, set the number format to "-1,234" and close the dialog with the OK button.

  6. Antallet dager fra den angitte datoen til dags dato vises i celle A3.

  7. Experiment with some additional formulas: in A4 enter =A3*24 to calculate the hours, in A5 enter =A4*60 for the minutes, and in A6 enter =A5*60 for seconds. Press the Enter key after each formula.

The time since your date of birth will be calculated and displayed in the various units. The values are calculated as of the exact moment when you entered the last formula and pressed the Enter key. This value is not automatically updated, although "Now" continuously changes. In the Data menu, the menu item Calculate - AutoCalculate is normally active; however, automatic calculation does not apply to the function NOW. This ensures that your computer is not solely occupied with updating the sheet.