How to convert a Unix timestamp to a date in Excel
Formula (Excel and Google Sheets)
=B2/86400+DATE(1970,1,1)Divide the seconds by 86,400 and add January 1, 1970: =B2/86400+DATE(1970,1,1).
- Result on the example
- one result per row in
C2, filled down toC6 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in C2, filled down to C6. Change any input and the result updates, or edit the formula to experiment.
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.
=B2/86400+DATE(1970,1,1)Result46082.5625
B21772371800The value in B2.
B2/8640020513.5625The / operator divides.
DATE(1970,1,1)1/1/1970 (25569)DATE: Builds a date from parts.- year
1970 - month
1 - day
1
- year
B2/86400+DATE(1970,1,1)46082.5625The + operator adds.
In Google Sheets
The same formula works in Google Sheets: =B2/86400+DATE(1970,1,1). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =B2/86400+25569 | 3/1/2026 13:30, 3/15/2026 8:05, 6/30/2026 23:45… | 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 | 3/1/2026 8:30, 3/15/2026 3:05, 6/30/2026 18:45…Different result | 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.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Convert a Unix timestamp to a date
C2, convert the Unix timestamp (seconds since January 1, 1970) to a date and time, and fill down to C6.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.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.