Back to Blog
Guides

Convert a Unix Timestamp to a Date in Excel

Use =A2/86400+DATE(1970,1,1) and format the cell as a date. For milliseconds, divide by 86400000. Formulas for time zones, Slack message timestamps, the reverse conversion, Google Sheets EPOCHTODATE and Power Query.

Slack Green Team
September 28, 2026
October 7, 2026
4 min read
Share:
excel
unix timestamp
google sheets
slack api

To convert a Unix timestamp to a date in Excel, use =A2/86400+DATE(1970,1,1), then format the cell as a date and time. A Unix timestamp counts seconds since 1 January 1970 in UTC. Dividing by 86,400, the number of seconds in a day, turns it into days, and adding DATE(1970,1,1) moves it onto Excel's own calendar. If your timestamp has 13 digits, it is in milliseconds: divide by 86,400,000 instead.

The result is in UTC. Formulas for your local time zone (daylight saving included), the reverse conversion, Google Sheets, Power Query and Slack's message timestamps are below.

For a one-off conversion without a spreadsheet, the free Slack timestamp converter turns a Unix timestamp into a date in your browser, and makes Slack date strings that show in each reader's time zone.

The formula for each case

The timestamp is in cell A2 in every example.

Seconds (10 digits):          =A2/86400+DATE(1970,1,1)
Milliseconds (13 digits):     =A2/86400000+DATE(1970,1,1)
Microseconds (16 digits):     =A2/86400000000+DATE(1970,1,1)
Timestamp stored as text:     =VALUE(A2)/86400+DATE(1970,1,1)
Date back to Unix seconds:    =(A2-DATE(1970,1,1))*86400

A quick check: 1727481600 should come out as 2024-09-28 00:00:00. If the result looks wrong, the date tells you which mistake you made:

  • • A date in January 1970: the timestamp is in seconds, and you divided it by 86,400,000. Use 86,400.
  • • ##### that stays after you widen the column: the timestamp is in milliseconds, and you divided it by 86,400. The result is past 31 December 9999, the last date Excel can show. Use 86,400,000.
  • • A date in 1954 (or 1958 on a 1904 workbook): the formula is missing +DATE(1970,1,1).
  • We tested every formula in Excel for Mac

    We ran each Excel formula on this page in Microsoft Excel for Mac 16.113.2 on 28 September 2026, with a seconds sample (1727481600) and a milliseconds sample (1727481600000). This is the sheet, copied from Excel as a picture:

    Excel for Mac test sheet: each Unix timestamp formula with its real result, including the ##### and 1970 errors
    Input in A2FormulaResult in Excel
    1727481600 (seconds)=A2/86400+DATE(1970,1,1)2024-09-28 00:00:00
    1727481600000 (milliseconds)=A2/86400000+DATE(1970,1,1)2024-09-28 00:00:00
    1727481600000000 (microseconds)=A2/86400000000+DATE(1970,1,1)2024-09-28 00:00:00
    1727481600000 (milliseconds)=A2/86400+DATE(1970,1,1)#####, value 20,019,569
    1727481600 (seconds)=A2/86400000+DATE(1970,1,1)1970-01-20 23:51:22
    1727481600 stored as text=VALUE(A2)/86400+DATE(1970,1,1)2024-09-28 00:00:00
    1727481600 stored as text=VALUE(A2)/864001954-09-27 00:00:00
    1727481600.123456 (Slack ts, text)=VALUE(LEFT(A2,10))/86400+DATE(1970,1,1)2024-09-28 00:00:00
    2024-09-28 00:00 (a date)=(A2-DATE(1970,1,1))*864001727481600

    The ##### result did not go away at a column width of 40 characters, because the value is past Excel's last date. A plain =A2/86400+DATE(1970,1,1) also worked on the text cell in our test, since Excel turns text into a number when you divide it. VALUE makes that step explicit.

    How the formula works

    Excel stores a date as the number of days since 1 January 1900, with the time of day as a fraction. 12:00 noon is 0.5. Unix time stores seconds since 1 January 1970. So the conversion is two steps: seconds to days, then add the days between 1900 and 1970.

    Many guides write that gap as 25569. That works in most workbooks, but Excel for Mac files can use the 1904 date system. We switched a test workbook to the 1904 system: =A2/86400+25569 turned 1727481600 into 2028-09-29, four years and one day late, while =A2/86400+DATE(1970,1,1) still gave 2024-09-28 00:00:00. DATE(1970,1,1) returns the right number in either system, so use it.

    Format the result as a date

    The formula returns a number such as 45563. To see a date:

  • Select the cells.
  • Press Ctrl+1 (Cmd+1 on Mac) to open Format Cells.
  • Choose Custom and type yyyy-mm-dd hh:mm:ss in the Type box.
  • Click OK.

To get the date as text in one step, wrap the formula: =TEXT(A2/86400+DATE(1970,1,1),"yyyy-mm-dd hh:mm:ss").

Never appear "away" on Slack again

Cloud-based. No downloads. Works 24/7 even when your laptop is off.

Convert the UTC result to local time

Unix time is always UTC. Add or subtract the offset in hours divided by 24. These are the results we got in Excel for 1727481600, which is 2024-09-28 00:00:00 UTC:

Time zoneFormulaResult in Excel
New York, summer (UTC-4)=A2/86400+DATE(1970,1,1)-4/242024-09-27 20:00:00
London, summer (UTC+1)=A2/86400+DATE(1970,1,1)+1/242024-09-28 01:00:00
India (UTC+5:30)=A2/86400+DATE(1970,1,1)+5.5/242024-09-28 05:30:00
India (UTC+5:30)=A2/86400+DATE(1970,1,1)+TIME(5,30,0)2024-09-28 05:30:00
Tokyo (UTC+9)=A2/86400+DATE(1970,1,1)+9/242024-09-28 09:00:00

For a half-hour offset, write the hours as a decimal (5.5 for 5:30) or add TIME(5,30,0). Both gave the same value in our test.

Excel has no time zone database, so a fixed offset is wrong for part of the year anywhere with daylight saving time. The formulas below work out the switch dates themselves. Put the UTC date in B2 first, with =A2/86400+DATE(1970,1,1).

In the United States, daylight saving time starts on the second Sunday of March at 2:00 local time (07:00 UTC) and ends on the first Sunday of November at 2:00 local time (06:00 UTC). UTC to New York:

=B2+IF(AND(B2>=DATE(YEAR(B2),3,8)+MOD(1-WEEKDAY(DATE(YEAR(B2),3,8)),7)+7/24,B2<DATE(YEAR(B2),11,1)+MOD(1-WEEKDAY(DATE(YEAR(B2),11,1)),7)+6/24),-4,-5)/24

DATE(YEAR(B2),3,8)+MOD(1-WEEKDAY(DATE(YEAR(B2),3,8)),7) is the first Sunday on or after 8 March, which is always the second Sunday of March. The November part finds the first Sunday on or after 1 November. For Chicago, change -4,-5 to -5,-6 and the switch times to 8/24 and 7/24. For Los Angeles, use -7,-8 with 10/24 and 9/24.

In the EU and the UK, clocks change on the last Sunday of March and the last Sunday of October, both at 01:00 UTC. UTC to London:

=B2+IF(AND(B2>=DATE(YEAR(B2),3,31)-MOD(WEEKDAY(DATE(YEAR(B2),3,31))-1,7)+1/24,B2<DATE(YEAR(B2),10,31)-MOD(WEEKDAY(DATE(YEAR(B2),10,31))-1,7)+1/24),1,0)/24

For Berlin, Paris, Madrid or Rome, change 1,0 to 2,1. On 28 September 2026 we filled an Excel for Mac 16.113 sheet with 256 UTC times from 2024 to 2030, including 7 times around each switch in every year, and ran the New York, London and Berlin formulas. All 768 results matched Python's zoneinfo. On 1 October 2026 we checked the same logic, Chicago and Los Angeles included, against zoneinfo for 256 times in Python, with 0 mismatches.

The formulas use only IF, AND, DATE, YEAR, WEEKDAY and MOD, so they also work in old versions of Excel, and every one of them exists in Google Sheets. They follow the current rules; if a country changes its switch dates, the formula needs the new dates. India, Japan, China and most of Arizona have no daylight saving time and need only the fixed offset. To check the offset for one date, use our Slack time zone converter.

Google Sheets: EPOCHTODATE

Google Sheets has a built-in function:

=EPOCHTODATE(A2)       seconds
=EPOCHTODATE(A2, 2)    milliseconds
=EPOCHTODATE(A2, 3)    microseconds

It returns UTC. The Excel formula =A2/86400+DATE(1970,1,1) also works in Sheets, so a shared file can use either. Our 28 September test covered Excel for Mac only. The Sheets formulas here and the Power Query ones below come from each product's documentation.

Power Query: Unix timestamp to datetime

In Power Query, add a custom column (Add Column, Custom Column) with:

#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [Timestamp])

For milliseconds, use [Timestamp] / 1000. To get local time with daylight saving handled, build a UTC datetimezone and convert it:

DateTimeZone.ToLocal(#datetimezone(1970, 1, 1, 0, 0, 0, 0, 0) + #duration(0, 0, 0, [Timestamp]))

ToLocal uses the time zone of the computer that refreshes the query. In KQL (Azure Data Explorer, Log Analytics), the same job is unixtime_seconds_todatetime(ts) or unixtime_milliseconds_todatetime(ts).

Slack and Discord timestamps in Excel

A Slack export or API response gives each message a ts such as 1727481600.123456. The part before the dot is Unix seconds; the part after keeps messages in the same second apart. Excel often reads it as text, so take the first 10 characters:

=VALUE(LEFT(A2,10))/86400+DATE(1970,1,1)

Slack's own date strings, such as <!date^1727481600^{date_short}|Sep 28>, carry the same seconds after the first caret. How Slack shows message times to people is in how to see the exact time a Slack message was sent. Discord's <t:1727481600:F> tags use Unix seconds too, and the same formula converts them. To make a Discord tag for a date, or read one back without a spreadsheet, use the free Discord timestamp generator.

FAQ

How do I convert a 13-digit timestamp in Excel? It is in milliseconds. Use =A2/86400000+DATE(1970,1,1).

How do I convert an Excel date to a Unix timestamp? =(A2-DATE(1970,1,1))*86400. Subtract your UTC offset first if the date is local time.

How do I convert UTC to EST in Excel? Subtract 5 hours: =B2-5/24. From the second Sunday of March to the first Sunday of November New York is on EDT, UTC-4, so use =B2-4/24 then, or the daylight saving formula above for a column that spans both.

Is a Unix timestamp UTC? Yes. Add your offset in hours divided by 24 to get local time.

Always Active

Stop Jiggling Your Mouse.

Join hundreds of remote workers who never worry about their Slack status. Set it up once, stay green forever.

Related Articles

Guide

Slack Daily Standup Without a Paid Bot: /remind, Workflow Builder and a Script

We set up a weekday 9:30 standup in a free Slack workspace three ways: a /remind reminder, Workflow Builder, and a short script that posts the questions and collects the thread replies.

Slack Green Team
Guide

Leave Multiple Slack Channels at Once: 4 Ways Timed, Plus a Script

Slack has no bulk leave button. We made 12 test channels and left them with the sidebar menu, the channel browser, /leave and a 30-line script, and timed each way.

Slack Green Team
Guide

Slack Bot Scopes: The Scope Each API Method Needs, Measured on 44 Methods

We gave a Slack bot one scope, called 44 common Web API methods, and read the needed field of every missing_scope error. Then we added the scopes and called them again. The table shows which scope clears each method.

Slack Green Team