# How to convert a Unix timestamp to a date in Excel

Divide the seconds by 86,400 and add January 1, 1970: `=B2/86400+DATE(1970,1,1)`.

**Excel:** `=B2/86400+DATE(1970,1,1)` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C |
| --- | --- | --- |
| Event | Unix time | Date (UTC) |
| Signup | 1772371800 |  |
| First order | 1773561900 |  |
| Upgrade | 1782863100 |  |
| Renewal | 1793232000 |  |
| Support call | 1798804800 |  |

Formula in C2, filled to C6: `=B2/86400+DATE(1970,1,1)`

Result: 3/1/2026 13:30; 3/15/2026 8:05; 6/30/2026 23:45; 10/29/2026 0:00; 1/1/2027 12:00

## How it works

A Unix timestamp counts the seconds since midnight on January 1, 1970, UTC. Dividing by 86,400, the seconds in a day, turns it into days, and adding the date of January 1, 1970 turns those days into a spreadsheet date with the time as the fraction.

## Other ways

- `=B2/86400+25569`: 25569 is the serial number of January 1, 1970; the same formula with the constant typed in.
- `=B2/86400+DATE(1970,1,1)-5/24`: Shifts from UTC to US Eastern Standard Time (UTC-5). (Five hours earlier.)

## Common mistakes

- Timestamps in milliseconds have 13 digits; divide by 86,400,000 instead.
- The result is UTC. Add or subtract hours/24 for your time zone, and remember daylight saving time.

## Questions

**How do I convert a date back to a Unix timestamp?**

`=(C2-DATE(1970,1,1))*86400`.

**Is there a function for this in Google Sheets?**

Yes: `=EPOCHTODATE(B2)` converts seconds. The formula above works there too.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/convert-a-unix-timestamp-to-a-date
