Unix Timestamp Converter
Convert dates to Unix seconds or milliseconds and convert timestamps back
Unix Timestamp Converter — what it does
Convert a date and time into Unix seconds and milliseconds, or turn a timestamp back into local and UTC date-times. Unix time counts seconds since 1 January 1970 UTC, and it is what logs, APIs and databases store because a single integer has no time zone ambiguity.
When this tool helps
- Reading a timestamp from a log file, API response or database column.
- Producing a timestamp value to use in a query or a request parameter.
- Checking a token's expiry claim by converting it to a readable time.
How to use it
- Enter a date and time, or use the current time.
- Read the Unix seconds and milliseconds values.
- Or paste a timestamp to convert back.
- Read the local and UTC date-times.
Accuracy, limits, and good practice
- Ten digits is seconds and thirteen is milliseconds — mixing them up puts your date in 1970 or fifty thousand years into the future.
- Unix time is always UTC. The local rendering is a display convenience, and the stored number carries no zone at all.
- JavaScript works in milliseconds while most backend languages default to seconds, which is the classic source of off-by-1000 bugs.
Frequently asked questions
Why does 1970 keep appearing?
Because a value of zero or a null is the Unix epoch itself. A date of 1 January 1970 nearly always means a missing timestamp.
What is the 2038 problem?
Signed 32-bit timestamps overflow in January 2038. Modern systems use 64-bit values, which push the limit far beyond any practical horizon.
Does Unix time include leap seconds?
No, it deliberately ignores them, which keeps arithmetic simple at the cost of tiny divergences from astronomical time.
Related tools on this site
- Advertising Metrics Calculator — Calculate CTR, CPC, CPM, CPA, conversion rate, and ROAS
- Commission Calculator — Calculate commission, bonuses, and total earnings
- Invoice Total Calculator — Add line items and calculate subtotal, discount, tax, and total
Everything above runs inside this page. Unix Timestamp Converter needs no account, no upload, and no server round trip — close the tab and nothing is left behind.
Unix 時間戳轉換器能做什麼
把日期時間轉成 Unix 秒與毫秒,或把時間戳轉回當地與 UTC 的日期時間。Unix 時間計的是自 1970 年 1 月 1 日 UTC 起的秒數,日誌、API 與資料庫都存它,因為單一整數不會有時區歧義。
什麼時候用得上
- 讀取日誌、API 回應或資料庫欄位中的時間戳。
- 產生查詢或請求參數要用的時間戳數值。
- 把權杖的到期宣告轉成看得懂的時間。
使用步驟
- 輸入日期時間,或使用目前時間。
- 查看 Unix 秒與毫秒數值。
- 或貼上時間戳進行反向轉換。
- 查看當地與 UTC 的日期時間。
精確度、限制與實務建議
- 十位數是秒、十三位數是毫秒——搞混會讓日期跑到 1970 年,或飛到五萬年後。
- Unix 時間永遠是 UTC。當地時間只是顯示上的方便,儲存的數字本身完全不帶時區。
- JavaScript 用毫秒,多數後端語言預設用秒,這正是經典的差一千倍錯誤來源。
常見問題
為什麼一直出現 1970 年?
因為值為 0 或 null 就是 Unix 紀元本身。日期顯示 1970 年 1 月 1 日,幾乎都代表時間戳遺失。
什麼是 2038 年問題?
有號 32 位元時間戳會在 2038 年 1 月溢位。現代系統改用 64 位元,上限已遠超任何實務考量。
Unix 時間有含閏秒嗎?
沒有,它刻意忽略閏秒,換得運算簡單,代價是與天文時間有極小的偏差。
本站相關工具
以上步驟全部在這個頁面內完成,Unix 時間戳轉換器 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。