對日期和時間進行計算

在 LibreOffice Calc 中,您可使用日期和時間執行計算,因為兩者均取自電腦的內部時鐘。例如,若要找出您的準確年齡 (以秒或小時為單位),請執行以下步驟:

  1. 開啟一個新的空白試算表。在儲存格 A1 輸入您的生日,例如 9.4.64 。

  2. 在儲存格 A3 中輸入下列公式:=NOW()-A1

  3. 按 ENTER 鍵後,您將看到以日期格式顯示的計算結果。如果要查看兩個日期之間相距的天數,則必須將儲存格 A3 格式化為數字形式。

  4. 請將游標設定在儲存格 A3 上,然後將它格式化為數字。為此,請在儲存格 A3 中啟動右鍵功能表 (按滑鼠右鍵),然後選取 [儲存格格式化...] 指令

  5. [格式化儲存格] 對話方塊會隨即出現。在 [數字] 標籤中,[數字] 分類將以色彩標明。此格式會設定為「General」,當計算結果中含有日期條目時,此結果將以日期顯示。若要以數字顯示結果,請將數字格式設定為「-1,234」,然後按一下 [確定] 按鈕關閉對話方塊。

  6. 您現在會看見在儲存格 A3 的天數介於今天和所輸入的日期之間。

  7. 您可以依希望輸入下列的公式:A4 中「=A3*24」為時數,A5 中「=A4*60」為分鐘數,以及和 A6 中「=A5*60」為秒數(全部不含引號),然後依上所述分別確認輸入。

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.

Please support us!