Processing raw Unix timestamps in Excel often frustrates analysts due to the lack of a native conversion button. While standard enterprise database sources natively format temporal data, Excel users must frequently bridge this gap manually. Fortunately, utilizing a mathematical formula grants instantaneous GMT readability without external plugins. One major stipulation to manage expectations is that Excel calculates time from a 1900 epoch, requiring us to divide the Unix integer by 86,400 and add a 25,569-day offset. For example, converting the timestamp 1609459200 accurately outputs January 1, 2021. Below, we outline the exact formula syntax and cell-formatting steps to streamline your workflow.
In the world of software development, database administration, and system logging, time is frequently recorded as a Unix timestamp (also known as Epoch time or POSIX time). A Unix timestamp represents the number of seconds (or milliseconds) that have elapsed since the Unix Epoch: January 1, 1970, at 00:00:00 UTC/GMT.
While computers love Unix timestamps because they are simple integers that prevent timezone confusion, humans find them impossible to read at a glance. For instance, the timestamp 1711881600 doesn't immediately look like Easter Sunday in 2024. When you export raw data into Microsoft Excel for reporting or analysis, converting these raw integers into clean, readable GMT dates is one of the first tasks you must tackle. This guide provides comprehensive, step-by-step instructions and the exact formulas you need to convert Unix timestamps to GMT dates in Excel.
To build the conversion formula in Excel, we must understand how both Unix and Excel handle dates:
1970-01-01 00:00:00 UTC.1900-01-01. In Excel, the integer 1 represents one full day, and fractional decimals represent hours, minutes, and seconds (e.g., 0.5 represents 12 hours/noon).Because Excel works in days and Unix works in seconds, converting a Unix timestamp to Excel's system requires two logical steps:
86,400 seconds).If your dataset contains standard 10-digit Unix timestamps (such as 1609459200 for January 1, 2021), use the following formula. Assuming your raw timestamp is in cell A2, enter this formula in your target cell:
=(A2 / 86400) + DATE(1970, 1, 1)
A2 / 86400: There are 86,400 seconds in a day (24 hours × 60 minutes × 60 seconds). Dividing your timestamp by 86,400 converts seconds into days.DATE(1970, 1, 1): This function returns Excel's serial number representation for January 1, 1970.If you prefer a shorter formula, you can replace the DATE(1970, 1, 1) function with its hardcoded Excel serial number equivalent, which is 25569. This is highly recommended for massive spreadsheets where performance and calculation speeds are critical:
=(A2 / 86400) + 25569
Many modern APIs, databases (like MongoDB), and JavaScript applications store timestamps in milliseconds instead of seconds. These are typically 13-digit numbers (e.g., 1609459200000).
If you try to use the standard 10-digit formula on a millisecond-based timestamp, Excel will return a date far into the future. To convert millisecond timestamps, you must divide by 86,400,000 (the number of milliseconds in a single day):
=(A2 / 86400000) + DATE(1970, 1, 1)
Or, using the optimized serial number shortcut:
=(A2 / 86400000) + 25569
When you first apply either of the formulas above, Excel will likely display a confusing raw decimal number (such as 44197.00) instead of a readable date. This is because the cell is still formatted as a generic "Number" or "General".
To transform this raw serial number into a legible GMT date format, follow these simple formatting steps:
Ctrl + 1 on Windows, Cmd + 1 on Mac).yyyy-mm-dd hh:mm:ss
2021-01-01 00:00:00.By default, the formulas provided above output the exact GMT/UTC date and time. However, you might want to display the timestamp in your local time zone instead of Greenwich Mean Time.
To adjust the GMT result to a local time zone, you must add or subtract your time zone offset. Because Excel counts days as whole integers, hours must be added or subtracted as fractions of 24 hours.
The general formula for local time zone conversion is:
= (Unix_Timestamp_Formula) + (Time_Zone_Offset / 24)
=((A2 / 86400) + 25569) - (5 / 24)
=((A2 / 86400) + 25569) - (4 / 24)
=((A2 / 86400) + 25569) + (1 / 24)
=((A2 / 86400) + 25569) + (5.5 / 24)
Below is a quick reference table showing how various raw Unix timestamps (in both seconds and milliseconds) translate to GMT dates using these exact formulas, once they have been properly formatted in Excel.
| Raw Unix Timestamp | Type | Excel Formula (GMT) | Formatted GMT Date Output |
|---|---|---|---|
0 |
Seconds | =(A2/86400)+25569 |
1970-01-01 00:00:00 |
1609459200 |
Seconds | =(A3/86400)+25569 |
2021-01-01 00:00:00 |
1609459200000 |
Milliseconds | =(A4/86400000)+25569 |
2021-01-01 00:00:00 |
1711885230 |
Seconds | =(A5/86400)+25569 |
2024-03-31 11:40:30 |
1711885230450 |
Milliseconds | =(A6/86400000)+25569 |
2024-03-31 11:40:30 |
If you run into issues while converting your timestamps, check for these common pitfalls:
If your output results in a year like 48503 or similar, you have applied the seconds formula (dividing by 86,400) to a millisecond timestamp. Double-check your source data. If the timestamp is 13 digits long, divide by 86400000 instead of 86400.
This error occurs if your Unix timestamps are formatted as text strings rather than numbers. This often happens during CSV imports. You can fix this by forcing Excel to treat the text as a number. Multiply the cell value by 1 within your formula:
=((VALUE(A2) / 86400) + 25569)
Alternatively, use the "Text to Columns" tool on your timestamp column to quickly convert the values back to numbers.
If you see a string of pound signs (#####) in your formatted date cell, it means either your column is not wide enough to display the text or the calculation has resulted in a negative value. Excel cannot natively display dates before January 1, 1900. If your timestamp is prior to 1970 (represented by negative integers), your formula may calculate a date that falls outside Excel's valid ranges.
Converting Unix timestamps in Excel is quick once you memorize these rules of thumb. Keep these tips handy for your next data import task:
=(Cell/86400)+25569.=(Cell/86400000)+25569.yyyy-mm-dd hh:mm:ss to view the true date and time.- (5/24) for EST).
Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.