India · Dubai · Delivering worldwide+91 86603 71224info@pyalm.com
Pyalm Labs logo
Free Tools

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

Nov 27, 2026

Prescription Abbreviations: What OD, BD, TDS, SOS and 1-0-1 Mean

A plain-English list of prescription abbreviations: dose timing (OD, BD, TDS, QID), when to take (AC, PC, HS, SOS), routes, forms, the 1-0-1 dose grid and abbreviations to avoid.

Nov 27, 2026

Handwritten vs Typed Prescriptions: Which Is Safer?

Why legibility matters in prescribing, what changes when clinics move from handwritten to typed or electronic prescriptions, and how to keep a handwritten signature.

Nov 27, 2026

How to Write a Prescription in India: Format and Rules

A practical prescription format for doctors in India: required details, generic names in capitals, the 1-0-1 grid, Schedule H and controlled drugs, and keeping records.

Nov 27, 2026

Prescription Pad Design: Letterhead Template for Clinics

What a professional prescription letterhead should include, paper size, layout, bilingual Arabic and English pads, QR codes for verification and printing tips.

Nov 27, 2026

Prescription Errors: 10 Common Mistakes and How Clinics Prevent Them

The ten prescription mistakes that cause dispensing errors, from illegible names and decimal points to missing durations, and simple fixes for clinics.

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.

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