茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1671771 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_0255.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2017/10/31 10:24:33

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)」

內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|