對這文章發表回應
發表限制: 非會員 可以發表
How to convert between date and Unix timestamp in Excel?
Unix timestamp is also called Epoch time or POSIX time which is wildly used in many operating systems or file formats. This tutorial is talking about the conversion between date and Unix timestamp in Excel.
Select a blank cell and type this formula =(A1-DATE(1970,1,1))*86400 into it and press Enter key, if you need, you can apply a range with this formula by dragging the autofill handle. Now a range of date cells have been converted to Unix timestamps.

Convert date and time to timestamp
There is a formula that can help you convert date and time to Unix timestamp.
1. Firstly, you need to type the Coordinated Universal Time into a cell, 1/1/1970. See screenshot:
2. Then type this formula =(A1-$C$1)*86400 into a cell, press Enter key, then if you need, drag the autofill handle to a range with this formula. See screenshot:
Tips: In the formula, A1 is the date and time cell, C1 is the coordinate universal time you typed.
Convert timestamp to date
If you have a list of timestamp needed to convert to date, you can do as below steps:
![]() | Never need to worry about long long formulas in Excel anymore! Kutools for Excel's Auto Text can add all formulas to a group as auto text, and liberate your brain! Click here to know Auto Text Click here to get free trial |
1. In a blank cell next to your timestamp list and type this formula =(((A1/60)/60)/24)+DATE(1970,1,1), press Enter key, then drag the auto fill handle to a range you need.
2. Then right click the cells used the formula, and select Format Cells from the context menu, then in the popping Format Cells dialog, under Number tab, click Date in the Category list, then select the date type in the right section.
3. Click OK, now you can see the Unix timestamps have been converted to dates.
Tips:
1. A1 indicates the timestamp cell you need.
2. This formula also can use to convert timestamp series to date and time, just format the result to the date and time format.
原文出處:
How to convert between date and Unix timestamp in Excel?
冷日:
簡單來說,Unix Time 本來就是從 1970 年的一月一日開始到現在的秒數,所以先把
DATE(1970,1,1)
但是還有一種特殊狀況,就是『 以 ms 為單位的 Unix Time』!
那也很簡單阿,就是把那 1000 也除掉阿!!!
也就是「=(((A1/60)/60)/24/1000)+DATE(1970,1,1)」