日期時間計算器 - 計算差異並加減時間
兩種模式:「差異」計算兩個日期時間之間的年、月、日、時、分、秒差距;「加減」從基準日期時間加減時間單位。不使用外部程式庫。
使用方法
- 在「差異」分頁中輸入開始和結束日期時間,自動計算差距
- 結果顯示年、月、日、時、分、秒的分類,以及總計
- 在「加減」分頁中設定基準日期時間、運算、值和單位
- 配置選項時自動計算結果
使用範例
Days until a deadline: Set today as start and the deadline as end to instantly see the remaining days.
Date 30 days from now: Add 30 days to today's datetime to find the target date.
Employment duration: Calculate years and months of employment from the hire date to today.
常見問題
- 「月」如何計算?
- 以 365.25 天 = 1 年,30.44 天 = 1 月作為近似值,可能存在細微誤差。
- 可以指定秒嗎?
- 可以。datetime-local 欄位接受秒。
- 可以計算過去的日期嗎?
- 可以。如果結束日期時間早於開始日期時間,結果會顯示負號。
- 資料會傳送至伺服器嗎?
- 不會。所有操作均在瀏覽器中執行。
- 是否考慮時區?
- 使用瀏覽器的本地時區。
相關工具
更新記錄
最後更新:2026-02-20
- 2026-02-19 初次發布