Google Sheets has no built-in EPOCHTODATE-style function in every locale, but you can convert a Unix timestamp to a readable date in seconds with a simple formula or with the built-in menu feature. For a timestamp in seconds in cell A2, the formula is =A2/86400+DATE(1970,1,1), formatted as a date and time. For a timestamp in milliseconds, divide by 86400000 instead. Sheets also offers a dedicated function called EPOCHTODATE on many accounts, which does the same job in one step.
What You'll Need
- A Google account with access to Google Sheets (the browser version at sheets.google.com is the easiest place to start).
- Your epoch values in a column, ideally as plain numbers with no commas, spaces or text characters mixed in.
- Knowledge of whether your timestamps are in seconds (10 digits) or milliseconds (13 digits). This single detail decides which formula you need.
Step-by-Step
- Identify the unit of your timestamp. Look at the length of the number. A typical Unix timestamp such as 1700000000 has 10 digits and is in seconds. A value like 1700000000000 has 13 digits and is in milliseconds. Some tools output microseconds, which have 16 digits. Getting this wrong is the most common cause of wrong results, so check before you type anything.
- Check your timestamps are numbers. Click a cell containing a timestamp and look at the formula bar. If the value appears with an apostrophe in front, or the cell is left-aligned while other numbers are right-aligned, Sheets is treating it as text. Select the column, then use Format > Number > Number to force numeric formatting, or use a formula like
=VALUE(A2)to convert text into a number. - Pick an empty cell next to your first timestamp, for example B2 if your data starts in A2. This keeps the original data intact so you can compare the result against the source.
- Enter the seconds formula. Type
=A2/86400+DATE(1970,1,1)and press Enter. The 86400 is the number of seconds in one day, andDATE(1970,1,1)is the Unix epoch, 1 January 1970 in UTC. Sheets counts dates as whole days since 30 December 1899, so adding the day count to the epoch date produces the correct calendar date. - Enter the milliseconds formula instead if you need it. Use
=A2/86400000+DATE(1970,1,1). The extra three zeros account for the thousand-fold larger unit. If you have microsecond timestamps, divide by 86400000000. - Format the result as a date and time. The cell will probably show something like 45291.70833, which is a serial number, not an error. Select the cell, open Format > Number > Date time for a date plus clock time, or Format > Number > Custom date and time to choose exactly which parts appear (for example day, month, year, hour and minute). Note that menu labels can differ slightly by version, device or region.
- Convert the whole column. Click the cell with your working formula, grab the small square handle at the bottom-right corner, and drag it down over the remaining rows. Double-clicking the handle will also fill the formula down to the last adjacent data row. Sheets adjusts the cell reference for each row automatically.
- Try the EPOCHTODATE function if your account has it. Type
=EPOCHTODATE(A2)and press Enter. This function takes a Unix timestamp and returns a date and time value, and it accepts an optional second argument for the time unit, where the default is seconds and milliseconds can be specified. If Sheets returns#NAME?, the function is not available on your account or locale and the arithmetic formula in the earlier steps is the reliable route. - Handle the time zone if precision matters. The arithmetic formula returns the time in your spreadsheet's time zone setting, which is usually your local zone, not UTC. If you need true UTC output, use
=(A2/86400+DATE(1970,1,1))-TIME(0,0,0)combined with the sheet's time zone set correctly under File > Settings > Time zone, or simply state clearly in a heading that times are local. Adjusting the time zone setting affects how every date in the file is displayed, so do it deliberately. - Label the new column. Add a header such as "Converted date (local)" so anyone opening the sheet later knows what the values mean and which unit was used.
Common Mistakes
Dividing by the wrong number. Using 86400 on a millisecond timestamp gives a date thousands of years in the future, typically showing an error or a year like 56000. Using 86400000 on a seconds timestamp gives a date in January 1970. Always match the divisor to the digit count.
Leaving the result as a raw serial number. Many people see 45291.7 and assume the formula failed. It has not; it is an unformatted date. Apply date formatting before judging the result.
Ignoring text-formatted timestamps. Values copied from CSV files, APIs or other apps often arrive as text. Arithmetic in Sheets will sometimes coerce text to numbers and sometimes return #VALUE!, so convert the column to numbers first.
Forgetting about local time. A timestamp of 1700000000 is 14 November 2023 at 22:13 UTC. In a sheet set to a different time zone the displayed hour changes, which can look like an error when comparing against another system.
Mistaking seconds for milliseconds because the number is short. Some sources omit leading digits or store dates after 2001 only, so count carefully rather than assuming.
Tips
Wrap the whole formula in ARRAYFORMULA to convert an entire column at once: with data in A2:A, enter =ARRAYFORMULA(IF(A2:A="","",A2:A/86400+DATE(1970,1,1))) in the first cell of an empty column. It fills down automatically and leaves blanks where the source is blank.
If you need just the date without the clock time, wrap the result in INT(), which strips the fractional part of the day.
To present the result as text you can paste elsewhere, use TEXT() with a format string, for example =TEXT(A2/86400+DATE(1970,1,1),"yyyy-mm-dd hh:mm"). This is useful when exporting to systems that would otherwise read a date serial as a plain number.
Keep the original timestamp column untouched and put conversions beside it. If a formula ever looks wrong, you can rebuild it from the raw data without losing anything.
For a one-off conversion, paste your timestamps into a temporary sheet and use Format > Number choices freely; experimenting there cannot damage your main data.
Troubleshooting
The formula returns #VALUE!. The source cell contains text that Sheets cannot interpret as a number. Clean it with VALUE(TRIM(A2)), or use Find and replace to strip commas, spaces and stray characters, then retry.
The date is in 1970 or far in the future. Your unit and divisor do not match. A near-1970 result means you divided a seconds value by 86400000; a year in the tens of thousands means the reverse.
The date is right but the time is off by hours. This is a time zone difference. Check File > Settings > Time zone and confirm the setting matches the zone the timestamps were recorded in, or adjust the output manually by the offset.
EPOCHTODATE shows #NAME?. The function is not available in your account, locale or file. The arithmetic method is fully equivalent, so switch to it.
The filled-down column shows identical dates. The cell references are probably locked with dollar signs, as in $A$2. Remove the dollar signs so the reference moves row by row.
Nothing recalculates after you change a timestamp. Check File > Settings > Calculation and make sure recalculation is not set to a manual option; setting it back to automatic updates results.
Frequently Asked Questions
Does Google Sheets have a built-in epoch converter?
Yes on many accounts: EPOCHTODATE converts a Unix timestamp to a date in one step. Where it is unavailable, the division formula gives the same result.
Why do I divide by 86400?
Sheets stores dates as days since 30 December 1899, so you must turn seconds into days. There are 86,400 seconds in a day, so dividing by that number expresses the timestamp in days, which you then add to the epoch date.
How do I know if my timestamp is in seconds or milliseconds?
Count the digits. Ten digits is almost always seconds; thirteen is milliseconds. If the converted year looks absurd, the divisor is wrong.
Can I convert a whole column at once?
Yes. Use the drag handle or double-click it to fill the formula down, or use ARRAYFORMULA for a single formula that covers the entire column.
Does the result use UTC or my local time?
The formula returns a value displayed in your spreadsheet's time zone setting. To show true UTC, set the file time zone to UTC or adjust the result by your offset.
Can I convert dates back to epoch values?
Yes. Subtract the epoch date and multiply by 86400 for seconds: =(B2-DATE(1970,1,1))*86400. Multiply by 86400000 instead to get milliseconds.