Unix Timestamp Converter

Convert Unix epoch timestamps to dates and back.

Now:

Seconds (default)
Milliseconds
UTC
-
Local
-
ISO 8601
-
Relative
-
Seconds
0
Milliseconds
0

What is a Unix timestamp?

A Unix timestamp is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970 - a moment known as the Unix epoch. It is the standard way computers represent a point in time, because it is a single number with no time zone, no formatting and no ambiguity.

That simplicity is the whole point. Comparing two timestamps is comparing two integers. Adding a day is adding 86,400. None of the complications of calendars, zones or locales apply until you convert to a human-readable form.

Key takeaways

  • A timestamp counts seconds since 1 January 1970 UTC.
  • JavaScript uses milliseconds; most other systems use seconds.
  • A timestamp has no time zone - it is an absolute instant.
  • Leap seconds are ignored by convention.
  • 32-bit signed timestamps overflow in January 2038.

Seconds or milliseconds?

This is the most common source of confusion, and the symptom is unmistakable: a date in 1970, or one about fifty thousand years in the future.

DigitsUnitExampleRepresents
10Seconds1789000000A date in 2026
13Milliseconds1789000000000The same moment
16Microseconds1789000000000000Used by some databases
19Nanoseconds1789000000000000000Go and some time-series systems

A quick check: a current timestamp in seconds is 10 digits, and in milliseconds 13. If you get 1970, you passed milliseconds to something expecting seconds.

JavaScript is the odd one out. Date.now() returns milliseconds, while Unix tooling, most databases and most APIs use seconds. Passing a JavaScript timestamp to an API expecting seconds produces a date around the year 58,000; passing seconds where milliseconds are expected gives 1970. Both are instantly recognisable once you know to look.

Useful reference values

TimestampDate (UTC)Significance
01 Jan 1970 00:00:00The Unix epoch
10000000009 Sep 2001One billion seconds
123456789013 Feb 2009A sequential curiosity
150000000014 Jul 2017
200000000018 May 2033Two billion seconds
214748364719 Jan 2038The 32-bit signed limit

The year 2038 problem

A 32-bit signed integer overflows at 03:14:07 UTC on 19 January 2038. Systems still storing timestamps that way will wrap round to December 1901. It is the same class of problem as Y2K, and while most modern systems use 64-bit values, embedded devices, older databases and legacy file formats remain genuinely at risk. A 64-bit timestamp is good for about 292 billion years.

Timestamps and time zones

A timestamp is an absolute instant with no zone attached. The same value converts to different wall-clock times in different places, but it refers to one moment.

Timestamp 1789000000Local time
UTC2026-09-09 12:26:40
London (BST)2026-09-09 13:26:40
New York (EDT)2026-09-09 08:26:40
Tokyo (JST)2026-09-09 21:26:40

One instant, five ways of writing it. This is exactly why storing timestamps rather than formatted date strings avoids so many bugs.

Leap seconds

Occasionally a leap second is added to UTC to keep it aligned with the Earth's rotation, which is gradually slowing. Unix time ignores them by definition - every day is exactly 86,400 seconds.

  • This means Unix time is not strictly a count of elapsed SI seconds since the epoch.
  • During a leap second, the same timestamp value is used twice or a value is skipped, depending on the implementation.
  • Most systems handle this by "smearing" the extra second across a longer period.
  • For almost all applications this is entirely irrelevant; for high-precision timing it is not.

Converting in code

LanguageCurrent timestampUnit
JavaScriptDate.now()Milliseconds
JavaScript (seconds)Math.floor(Date.now() / 1000)Seconds
Pythonint(time.time())Seconds
PHPtime()Seconds
JavaInstant.now().getEpochSecond()Seconds
Gotime.Now().Unix()Seconds
SQL (Postgres)EXTRACT(EPOCH FROM NOW())Seconds
Shelldate +%sSeconds
Everything runs in your browser. Nothing you enter is uploaded, logged or stored on a server.

Frequently Asked Questions

What is a Unix timestamp?

The number of seconds elapsed since 00:00:00 UTC on 1 January 1970, known as the Unix epoch. It represents an absolute instant as a single number, with no time zone or formatting attached.

Why does my timestamp convert to 1970?

Because you passed a value in seconds to something expecting milliseconds, or the value is genuinely near zero. A current timestamp is 10 digits in seconds and 13 in milliseconds - checking the digit count identifies the problem immediately.

What is the difference between seconds and milliseconds?

A factor of 1,000. JavaScript's Date.now() returns milliseconds, while Unix tools, most databases and most APIs use seconds. Mixing them gives either 1970 or a date tens of thousands of years away.

Does a Unix timestamp have a time zone?

No. It is an absolute instant, always measured from UTC. The same timestamp displays as different local times around the world, but it refers to one moment. This is precisely why storing timestamps avoids so many time zone bugs.

What is the year 2038 problem?

A 32-bit signed integer can hold timestamps only up to 03:14:07 UTC on 19 January 2038, after which it overflows and wraps to December 1901. Most modern systems use 64-bit values, but embedded devices and legacy formats remain at risk.

Does Unix time account for leap seconds?

No. By definition every day is exactly 86,400 seconds, so Unix time is not strictly a count of elapsed SI seconds. Most systems smear leap seconds across a longer period. This is irrelevant for almost all applications.

How do I get the current timestamp in code?

Date.now() in JavaScript for milliseconds, or divide by 1000 for seconds. time.time() in Python, time() in PHP, time.Now().Unix() in Go, and date +%s in a shell - all of which return seconds.

Why use timestamps instead of formatted dates?

Because a timestamp is unambiguous, sorts correctly as a number, requires no parsing, and carries no time zone or locale assumptions. Formatted date strings introduce all of those problems and are a frequent source of bugs.

Related Calculators