For Developers

Unix Timestamp in Excel

How to convert a Unix timestamp to a readable date in Excel, and back — Excel doesn't use Unix time at all, so every formula here is really a conversion between two different epochs.

=(NOW()-DATE(1970,1,1))*86400
=A1/86400+DATE(1970,1,1)
' then format the cell as a date/time
=(A1-DATE(1970,1,1))*86400

The Excel-specific pitfall

Excel dates aren't Unix timestamps — internally, a cell formatted as a date is a serial number counting days since December 30, 1899 (with a deliberate off-by-one bug baked in to match a Lotus 1-2-3 leap-year error from the 1980s, kept for backward compatibility ever since). That's an entirely different epoch and a different unit — days, not seconds. Every formula converting to or from Unix time is really bridging two epochs at once: multiply/divide by 86400 for the seconds-to-days conversion, and add/subtract the 1970 date serial for the epoch shift. Skip either half and the result lands decades off.

Have a timestamp right now?

Paste it into the Timestamp ⇄ Date Converter to check it instantly, in any timezone, without writing any code. Working across several languages on the same project? The full Epoch Time in Programming Languages guide has all of them side by side for quick comparison.

Related

Related tools & reading