在線即時計算器 · 純前端本地秒算 · 零數據上傳

🛠️ Days Before Date 計算機

專業免費的 Days Before Date 計算機。純前端本機毫秒級計算、零資料上傳、極致隱私保護。提供詳細公式推導、實例示範與常見問答。

即時推算結果 (Computed Output)
2026-06-05 Friday
專業公認計算模型,即時運算完畢
📜 計算歷史記錄 (試算軌跡)
尚無歷史記錄,每次點擊「計算」將在此留下試算軌跡...

What this calculator does

This tool tells you which calendar date falls a chosen number of days before a base date, and which day of the week that is. Enter a base date and a count N, and it subtracts the days — correctly crossing month and year boundaries and respecting leap years — using serial-day (Julian Day Number) arithmetic. The date math itself is universal and works for any reader worldwide.

Japanese era (wareki) note

The optional Calendar / Era selector is a Japan-specific convenience. Choose Western (CE) (the default) to enter the Gregorian year directly. Or pick a Japanese imperial era — Meiji, Taisho, Showa, Heisei, or Reiwa — and type the era year; the tool adds the era offset to get the Gregorian year (for example Reiwa 6 = 2024). Era input is only meaningful from Meiji 6 (1873), when Japan adopted the Gregorian calendar.

How to use it

1) Pick the calendar/era. 2) Enter the year, month, and day of your base date. 3) Enter how many days before (N). 4) Choose whether the base day itself counts as day 1. The "Count" option is useful for inclusive counting such as Japanese mourning anniversaries (for example the 49th-day, "shijukunichi"). Tip: entering a negative N computes a future date instead.

The formula

GregorianYear = enteredYear + eraOffset. The base date is converted to a serial day number; delta = N when the first day is not counted, or N−1 when it is counted; resultDate = baseDate − delta days. The weekday comes from the serial number modulo 7.

\begin{gathered} Result Date = JDN^{-1}\!≤ft(JDN(Base Date) - Δ\right) \\[1.5em] where ≤ft{ \begin{aligned} Base Date &= \big(Year + Era,\ Month,\ Day\big) \\ Δ &= Days before \end{aligned} \right. \end{gathered}

Worked example

Base date 2024-06-15, N = 10, first day not counted. delta = 10, so

15 - 10 = 5,
giving 2024-06-05, which is a Wednesday.

使用注意事項與精準校對原則(6 大核心守則)

📐 1. 嚴格對齊輸入量綱與單位

輸入各項數值時請務必確認量綱(例如小時、天數、金額、百分比),避免單位不匹配引發推算偏差。

🔒 2. 純前端本機毫秒級隱私保障

所有計算邏輯 100% 在您的終端瀏覽器內完成,資料絕不上傳伺服器,嚴格守護商業與個人隱私。

📊 3. 符合公認學術與產業計算模型

演算法嚴格遵循國際通用數學公式與標準計算模型,經多重情境交叉核對,數值嚴密精確。

📋 4. 一鍵複製與免登入 PDF 匯出

支援一鍵複製推算結果字串至剪貼簿,亦可直接點擊列印按鈕輸出純淨 PDF 工作報表。

🔄 5. 多情景敏感度動態對比

建議針對極端值與多組預期情景分別試算,觀察輸出數據的波動區間,輔助做出更穩健的決策。

🛡️ 6. 專業諮詢與日常參考免責聲明

本工具運算結果供日常排程、學業研習與事前參考之用,如涉及重大法規或投資決策請諮詢持證專家。

常見問題 (FAQ)

What does "count the first day" mean?
If counting, the base day is day 1, so only N−1 days are actually subtracted. If not counting, the full N days are subtracted.
Does it handle leap years?
Yes — February gets 29 days in leap years (divisible by 4, except centuries not divisible by 400), handled automatically.
Can I get a future date?
Yes. Enter a negative number of days to count forward from the base date.