Developer Time

Epoch converter

Direction
Epoch time
UTC date and time 2001-09-09T01:46:40Z
Epoch is 1 January 1970, 00:00:00 UTC
The same moment
In words Sunday 9 September 2001
Day of the week Sunday
Read as read as seconds
Date only 2001-09-09
In milliseconds 1,000,000,000,000
Julian day 2,452,161.57407
Note
Ten digits is seconds · thirteen is milliseconds
A value from todayDigitsWhat it is
170000000010Unix seconds
170000000000013Unix milliseconds — JavaScript
170000000000000016Unix microseconds — PostgreSQL, Python
170000000000000000019Unix nanoseconds — Go, Prometheus
13344473600000000018Windows FILETIME and LDAP, from 1601
63835596800000000018.NET ticks, from year one
45244.935 and a fractionExcel serial, from 1899-12-30
2460000.57 and .5Julian Day, from 4713 BC

A signed 32-bit integer holds seconds up to 2,147,483,647, which runs out at 03:14:07 UTC on 19 January 2038. Systems still storing timestamps that way will wrap to 1901. It is the same shape of problem as Y2K and has been known about for decades. 64-bit time handles it, and most modern systems have moved, but embedded devices are still being found.

The Unix epoch is midnight UTC on 1 January 1970, and epoch time counts seconds from it: 1000000000 was 01:46:40 UTC on 9 September 2001. The same panel reads milliseconds, microseconds and nanoseconds, Windows FILETIME from 1601, .NET ticks from year one, Excel serials from 1899 and Julian days from 4713 BC.

How to convert epoch time

1 Paste the value, including the minus sign if it has one. Count its digits against the table below if you are not sure what it is.
2 For anything other than plain Unix time, switch to the other-systems tab and pick the epoch it came from.
3 Read the human-readable date and time, which are always UTC: an epoch value carries no timezone of its own.
4 Switch the direction to go the other way, from a date to the number a given system would store.

Negative epoch values are perfectly valid and represent dates before 1970. Epoch −86400 is 31 December 1969. A surprising amount of software mishandles them, either rejecting the value or producing a date decades out, because the implementation assumed unsigned arithmetic. It is worth testing if you are handling historical dates and not just log timestamps.

The other thing epoch time is not is a count of elapsed seconds. Every day in Unix time is defined as exactly 86,400 seconds, so when a leap second is inserted the clock repeats a value instead of counting past it. Twenty-seven leap seconds have been added since 1972, which means the real interval between two epoch values that far apart is 27 seconds longer than the subtraction says. That is deliberate: it keeps epoch arithmetic to plain division and lets every date convert without a lookup table, and it is the reason epoch time and atomic time are different quantities. The General Conference on Weights and Measures resolved in 2022 to widen the tolerance between UTC and the Earth’s rotation by or before 2035, which ends leap-second insertions in practice; the discrepancy then stops growing and stays where it is.

Everything else on this page exists because the unit and the origin are both guesses unless someone wrote them down. Digit count settles the unit for Unix values: ten is seconds, thirteen milliseconds, sixteen microseconds, nineteen nanoseconds, and a value read one step out lands in 1970 or in the year 57000 instead of failing. Origin is harder. Windows FILETIME counts from 1 January 1601, chosen because that year opens the first complete 400-year Gregorian cycle after the 1582 reform, which makes the calendar arithmetic land on round numbers. Active Directory reuses the identical encoding, which is why an LDAP timestamp, a pwdLastSet and a lastLogonTimestamp are all FILETIME values and all need the same sentinel handling. .NET ticks use the same 100-nanosecond unit but count from year one, and at a current date both formats run to eighteen digits, so only magnitude tells them apart.

Excel counts whole days from 1899-12-30 with the time as a fraction, and it believes 1900 was a leap year because Lotus 1-2-3 did in 1983 and file compatibility was worth more than the bug; serial 60 is a day that never existed. A spreadsheet four years out came from Mac Excel and its 1904 epoch instead. PostgreSQL stores microseconds from 2000-01-01, not 1970, so a raw internal value needs the epoch shift as well as the unit. And once a value passes eighteen digits, JavaScript cannot hold it in a Number at all: the safe integer range ends at 2^53 − 1, so the last digits are silently lost unless the value is kept as a BigInt or a string.

None of these formats carries a time zone, and neither does a bare date string. The inhabited offsets span twenty-six hours, from UTC−12 to UTC+14, so a date written without a zone marker is ambiguous by that much: two systems in different places can honestly disagree about which calendar day a naked "2024-01-01" belongs to. JavaScript makes the trap concrete. new Date("2024-01-01") is parsed as UTC because it is date-only, new Date("2024-01-01T12:00:00Z") is UTC because of the Z, and new Date("2024-01-01T12:00:00") is your local time because the standard says a date-time without an offset is local. The space-separated new Date("2024-01-01 12:00") is not in the standard at all and is read as local by the engines that accept it. The same hole exists in .NET in a different shape: a DateTime carries only a Kind flag, and that flag does not survive most serialisation, which is precisely why DateTimeOffset exists.

What people use it for

  • Reading a timestamp from a log or database
  • Converting a date for an API request
  • Decoding a thirteen-digit JavaScript timestamp
  • Decoding a sixteen-digit PostgreSQL timestamp
  • Decoding a nineteen-digit Go or Prometheus timestamp
  • Reading a tick value out of a C# log
  • Producing a .NET tick value for a test fixture
  • Decoding a file or registry timestamp on Windows
  • Writing an accountExpires value for Active Directory
  • Reading lastLogonTimestamp out of an AD export
  • Decoding a spreadsheet column that imported as numbers
  • Turning a date into the serial number Excel stores
  • Computing an interval for astronomy software
  • Converting a historical date to a negative epoch

Questions

Midnight UTC on 1 January 1970. Epoch time counts seconds from that moment.

NIST — leap seconds FAQBIPM — Resolution 4 of the 27th CGPM (2022), on the future of the leap secondMicrosoft — file times, the 1601 epoch and 100-nanosecond intervalsMicrosoft — DateTimeOffset, and why DateTime.Kind is not enoughMDN — Date.parse and the local-versus-UTC rule
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding