What Is a Unix Timestamp? Epoch Time Explained With Examples

Databases, APIs, logs and JWT tokens often store time as a single number like 1773480600. That number is a Unix timestamp: the number of seconds since 1 January 1970 at 00:00:00 UTC. It is simple, compact and the same everywhere in the world – but it is not readable until you convert it.

Free tool
Convert a Unix timestamp
Turn seconds or milliseconds into a readable date in UTC and your local time, convert any date to a timestamp, and copy code snippets. Free.
Open Unix Timestamp Converter →

Why 1970?

The “Unix epoch” – 1970-01-01T00:00:00Z – was chosen by the early Unix developers as a convenient starting point. Every moment is counted from it; dates before 1970 are negative numbers.

Seconds or milliseconds?

Digits (today)UnitCommon in
10SecondsUnix, PHP, Python time.time(), most APIs, JWT exp
13MillisecondsJavaScript Date.now(), Java/Kotlin System.currentTimeMillis()
16MicrosecondsSome databases and logs

If a date converts to January 1970 or to a year far in the future, you probably mixed up seconds and milliseconds. Our converter detects the unit automatically.

Time zones

A Unix timestamp has no time zone – it is always UTC. Time zones only matter when you display it. The same timestamp is 09:30 in London and 15:00 in New Delhi. Store timestamps (or UTC dates) and convert to local time only for display.

Converting in code

LanguageNow (seconds)Timestamp to date
JavaScriptMath.floor(Date.now() / 1000)new Date(ts * 1000)
Pythonint(time.time())datetime.fromtimestamp(ts, timezone.utc)
Kotlin / JavaInstant.now().epochSecondInstant.ofEpochSecond(ts)
PHPtime()date('Y-m-d H:i:s', $ts)
MySQLUNIX_TIMESTAMP()FROM_UNIXTIME(ts)
PostgreSQLextract(epoch from now())to_timestamp(ts)

The year 2038 problem

Systems that store timestamps as signed 32-bit integers can only count up to 2,147,483,647 – which is reached at 03:14:07 UTC on 19 January 2038. After that the number overflows. Modern systems use 64-bit integers, which last for billions of years, but old embedded devices and databases may still need updates.

Leap seconds

Unix time ignores leap seconds – every day is exactly 86,400 seconds. That keeps calculations simple and is fine for almost all applications.

Where you will see timestamps

  • API responses and webhooks
  • Log files
  • JWT claims such as exp and iat – decode them with our JWT Decoder
  • Cron jobs and schedulers – see the cron expression guide
  • Database columns like created_at

FAQ

What is the current Unix timestamp?

Open the converter – it shows a live epoch clock.

How do I know if a timestamp is in seconds or milliseconds?

Today, 10 digits usually means seconds and 13 digits means milliseconds.

Is a Unix timestamp in UTC?

Yes. It counts seconds since 1 January 1970 UTC and has no time zone.

Can Unix timestamps be negative?

Yes. Negative values represent dates before 1970.

What happens in 2038?

Systems using signed 32-bit timestamps overflow on 19 January 2038. 64-bit systems are not affected.

Free tool
Try the free Unix Timestamp Converter
No signup and nothing uploaded – it runs right in your browser. Browse all 74 free tools on our Free Tools page.
Open Unix Timestamp Converter →

Need a website or app for your business? Talk to Techpass Master – we design and build websites and apps for clients worldwide.

WhatsApp us📞 Call now