Free Tools
By Fadhil Abdulla

Unix Timestamps Explained: Epoch Time, Seconds vs Milliseconds and Time Zones

What epoch time is, why it's the standard way to store dates, how to tell seconds from milliseconds, and how to avoid the time-zone bugs it causes.

Editorial disclosure: Pyalm publishes and maintains the products and free tools discussed on this site. Regulatory statements are linked to primary sources where applicable. No independent professional review is claimed unless a reviewer is explicitly named.

A Unix timestamp is the number of seconds since 00:00:00 UTC on 1 January 1970 — "the epoch". 1760572800 is a moment in October 2025. Databases, logs, JWTs, payment APIs and webhooks all use it because a single number has no time zone, no formatting and no ambiguity.

Convert a timestamp in seconds

Paste it into the free Epoch Converter. It shows the date in UTC, your local time and any time zone, plus ISO 8601 and how long ago (or how far ahead) it is. It also converts the other way, from a date to a timestamp.

Seconds, milliseconds, microseconds

Digits (today) Unit Typical source
10 Seconds Unix, PHP time(), Python int(time.time()), JWT exp
13 Milliseconds JavaScript Date.now(), Java, many APIs
16 Microseconds PostgreSQL internals, some logging systems
19 Nanoseconds Go, high-resolution tracing

Treat milliseconds as seconds and you get a date tens of thousands of years in the future; the reverse lands in January 1970. If a dashboard shows 1970, a unit mix-up is the usual suspect.

Time zones: store UTC, display local

A timestamp is always UTC. Time zones only enter when you display it. The safe pattern:

  1. Store timestamps (or ISO 8601 with Z) in UTC.
  2. Convert to the user's time zone only in the interface.
  3. Never store a "local time" without its zone.

Bugs appear when one system writes local time and another reads it as UTC — the classic "everything is 4 hours off" in Dubai (UTC+4) or "5½ hours off" in India (UTC+5:30).

Handy snippets

JavaScript   Math.floor(Date.now() / 1000)
Python       import time; int(time.time())
PHP          time();
PostgreSQL   SELECT extract(epoch FROM now());
MySQL        SELECT UNIX_TIMESTAMP();
Bash         date +%s

The year 2038 problem

Systems that store Unix time in a signed 32-bit integer overflow at 03:14:07 UTC on 19 January 2038 and wrap to 1901. Modern languages and databases use 64-bit values, but old embedded devices and legacy database columns (INT instead of BIGINT) are still at risk. Check any long-lived data such as loan end dates, warranties and licences.

Leap seconds

Unix time ignores leap seconds — every day is exactly 86,400 seconds. For business software this never matters; for scientific timing, use specialised time scales.

Where timestamps meet business logic

Invoice due dates, subscription renewals, SLA timers and scheduled reports all depend on getting time right across zones. Pyalm builds business automation and custom software where scheduling and time zones are handled properly — including UAE weekends and multi-country teams.

Epoch Converter | Time Zone Converter | Cron Expression Generator | JWT Decoder | All free tools

Keep reading

More from Pyalm

Oct 16, 2026

How to Format and Validate JSON (and Fix the 6 Most Common Errors)

Why JSON breaks, how to read a validator's error message, and a quick routine for pretty-printing, minifying and fixing JSON from APIs, logs and config files.

Oct 16, 2026

How to Compare Two JSON Files (Without Drowning in Diff Noise)

Text diffs flag reordered keys and whitespace as changes. Here's how a structural JSON comparison works, and how to use it to review API changes, configs and migrations.

Oct 16, 2026

Regex Cheat Sheet with Real Examples (Emails, Phones, Dates, UAE TRN)

A practical regular expression cheat sheet — the syntax you actually use, plus tested patterns for emails, UAE and Indian phone numbers, dates and tax numbers.

Oct 16, 2026

URL Encoding Explained: %20, + and When to Encode

What percent-encoding is, why spaces become %20, the difference between encodeURI and encodeURIComponent, and how to avoid double-encoding bugs.

Oct 16, 2026

Minify vs Beautify: What Code Minification Does and When to Use It

How minifying JavaScript, CSS and HTML shrinks files, how much it really saves, and when to beautify minified code to debug it.

Oct 16, 2026

Why You Should Test with Fake Data (and How to Generate It in Seconds)

Using real customer data in development is a privacy risk; using 'test123' hides bugs. Here's how realistic fake data helps — with regional formats for the UAE, India, US and UK.

Try the free Epoch / Unix Timestamp Converter

Pyalm builds custom software, APIs and integrations for businesses in India and the UAE. We made these developer tools for our own team — use them free, and talk to us when you need something built.

Open Epoch / Unix Timestamp Converter See custom software All free tools