Tip: Other languages are Google-Translated. You can visit the English version of this link.
or

Register

or
0
0
0
s2smodern

## 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.

Convert date to timestamp

Convert date and time to timestamp

Convert timestamp to date

#### Quickly remove time from date time formatting cells (1/20/2018 13:12:11 => 1/20/2018) in Excel

If you have a list of date time formatting cells, and you need to remove the time from the date time cells permanently and only keep the date format content in cells, for example, to remove 12:11:31 from 1/21/2017 12:11:31 and make it exactly 1/21/2017. How to quickly handle this job in Excel? With Kutools for Excel’s Commonly-used Formulas, you can quickly use the built-in formula to remove timestamp permanently from the date time formatting in Excel.  Click for 60 days free trial!

#### Convert date to timestamp

###### Amazing! Using Tabs in Excel like Firefox, Chrome, Internet Explore 10!

To convert date to timestamp, a formula can work it out.

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:

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.

#### Quickly and easily convert date to other data formatting in Excel

Have you ever tried to convert a date to day, month or year only? The formulas maybe hard to remember, but the Apply Date Formatting of Kutools for Excel can quickly convert a standard date to the date formatting as you need as below screenshot shown. Dont, waite, click for 60 days free trial!

### Recommended Productivity Tools

#### Office Tab

Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

#### Kutools for Excel

Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

200 New Features for Excel, Make Excel Much Easy and Powerful:

• Merge Cell/Rows/Columns without Losing Data.
• Combine and Consolidate Multiple Sheets and Workbooks.
• Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
• Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,

Say something here...
symbols left.
###### or post as a guest, but your post won't be published automatically.
People in conversation:
• To post as a guest, your comment is unpublished.
· 7 months ago
One thing to note is that the above is for epoch time in seconds. If you need milliseconds, you need to add a further multiplication / division by 1000. For example, converting from epoch time (milliseconds) to a date would be "=((((A1/1000)/60)/60)/24)+DATE(1970,1,1)".
• To post as a guest, your comment is unpublished.
· 7 months ago
As a side note, the best way to tell if it's seconds or milliseconds is looking at the length of the field; if it's 10 digits, it's seconds, and if it's 13 digits, it's milliseconds. "=LEN(A1)" will tell you how long the value is.
• To post as a guest, your comment is unpublished.
· 1 months ago
If that's too much manual work for you (or you have a list that's mixed between seconds and milliseconds), then you can use the following formula to automatically switch between seconds and milliseconds based on the length of the cell: "=((A1/86400)/IF(LEN(A1)=13,1000,1))+DATE(1970,1,1)".
• To post as a guest, your comment is unpublished.
· 9 months ago
I followed your instructions here, but I get ########## in my excel file. I formatted it to date time. Any suggestions?
• To post as a guest, your comment is unpublished.
· 4 months ago
Had the same problem, but I figured it out. The cell has to have number format, not date format...
• To post as a guest, your comment is unpublished.
· 6 months ago
yeah me too, I got the same problem
• To post as a guest, your comment is unpublished.
· 5 months ago
Which formula you use?
• To post as a guest, your comment is unpublished.
· 9 months ago
Normally you see ########## if there's too much information to display for how big you have your cells. Enlarge your cell size and see if that resolves the issue.
• To post as a guest, your comment is unpublished.
· 9 months ago
Excuse me, could you tell me which part did not work in your file? Could you upload the detail screenshot for me to have a look?
• To post as a guest, your comment is unpublished.
· 7 months ago
Goggle for "excel convert timestamp to date". Google, grabbing the first answer which is for date to timestamp, gives the answer of "=(A1-DATE(1970,1,1))*86400", which is what Sunny was probably doing. Only if you actually read the content of this page does it become obvious that the actual formula should be something else. To keep the time portion of the timestamp, the formula should be this for UTC "=(A1+DATE(1970,1,1)*86400)/86400". For US Central time, "=(F2+DATE(1970,1,1)*86400-21600)/86400"
• To post as a guest, your comment is unpublished.
· 7 months ago
Thank u for you suppelment.
• To post as a guest, your comment is unpublished.
· 1 years ago
Thank you!

(Your comment is too short! - it was responce to my first line, so I just add this junk :P )
• To post as a guest, your comment is unpublished.
· 6 months ago
Using =(((((G2/1000)/60)/60)-8)/24)+DATE(1970,1,1) for PST