What is Unix epoch time?
Unix epoch time (also called POSIX time or Unix time) is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC — a date known as the Unix epoch. It was chosen as the reference point when Ken Thompson and Dennis Ritchie needed a compact, timezone-agnostic way to represent time in the original Unix operating system at Bell Labs. The convention stuck: virtually every modern OS, programming language, and database engine uses epoch-based timestamps internally, even if they display something friendlier to humans.
Because epoch time is a single integer, it sidesteps the ambiguity of date strings. There's no guessing whether 03/04/2025 means March 4th or April 3rd, and there's no timezone offset to parse. Sorting, comparing, and doing arithmetic on epoch values is trivial — subtraction gives you the duration between two events in seconds.
The trade-off is readability. 1744444800 doesn't tell a human anything at a glance — which is exactly why epoch converters exist.
One well-known limitation: traditional 32-bit signed integers can only represent epoch values up to 2,147,483,647, which corresponds to January 19, 2038 at 03:14:07 UTC. After that, the counter overflows and wraps to a negative number — the so-called Year 2038 problem (Y2K38). Most modern systems have migrated to 64-bit time, which pushes the limit roughly 292 billion years into the future, but legacy embedded systems and older databases may still be vulnerable.
Seconds vs milliseconds timestamps
Not all epoch timestamps use the same unit, and confusing seconds with milliseconds is one of the most common bugs in timestamp handling. The quickest way to tell them apart is digit count:
- 10 digits — Unix seconds. Example:
1744444800(April 12, 2025). This is the classic Unix convention used by C'stime(), Python'stime.time(), and most server-side APIs. - 13 digits — JavaScript milliseconds. Example:
1744444800000. This is whatDate.now()returns in JavaScript/TypeScript and what Java'sSystem.currentTimeMillis()uses.
If you accidentally pass a millisecond timestamp to an API that expects seconds, you'll get a date tens of thousands of years in the future. Going the other direction, a seconds timestamp treated as milliseconds will resolve to a date in January 1970 — just hours after the epoch. This converter auto-detects the unit based on digit count so you don't have to think about it.
Common epoch timestamp formats
Epoch time is the internal representation, but timestamps appear in several serialization formats depending on context:
- Unix seconds — a plain integer like
1744444800. The most compact form, used in C, Go, Python, Ruby, and PHP by default. - JavaScript milliseconds — the same value multiplied by 1000. Native to browser APIs and Node.js.
- ISO 8601 —
2025-04-12T08:00:00Z. The international standard for date-time interchange. The trailingZdenotes UTC. This is what JSON APIs, PostgreSQL'stimestamptz, and OpenAPI schemas typically use. - RFC 2822 —
Sat, 12 Apr 2025 08:00:00 +0000. The email header format, also used in HTTPDateandLast-Modifiedheaders. - Human-readable local time — varies by locale and timezone. Useful for display but ambiguous for data exchange because the timezone must be specified separately.
This tool converts between all of these formats instantly. Paste any epoch value and get every representation at once, or enter a human-readable date and get the corresponding Unix timestamp.
Where you'll encounter epoch timestamps
Epoch timestamps show up in almost every layer of a modern tech stack:
- REST and GraphQL APIs — many APIs return
created_at,updated_at, andexpires_atas epoch integers rather than formatted strings. Stripe, Twilio, and Slack are notable examples. - JWT claims — the
iat(issued at),exp(expiration), andnbf(not before) fields in a JSON Web Token payload are all epoch seconds. Use our JWT Decoder to inspect those claims. - Database timestamps — MySQL's
UNIX_TIMESTAMP(), PostgreSQL'sEXTRACT(EPOCH FROM ...), and SQLite's default integer storage all deal in epoch seconds. - Log files — syslog, nginx access logs, and application logging frameworks often prefix entries with epoch timestamps for unambiguous, sortable ordering.
- Cron and scheduling — cron-based systems record last-run and next-run times as epoch values. See our Cron Expression Generator for building and validating cron schedules.
- Cookies and cache headers — the
Expiresattribute in HTTP cookies and themax-agedirective inCache-Controlare epoch-derived or relative-seconds values. - Git internals — every commit object stores author and committer dates as epoch seconds with a timezone offset.
Related tools on CodeBoxTools
- Cron Expression Generator — build, validate, and explain cron schedules visually.
- UUID Generator (v4/v7) — UUIDv7 embeds a millisecond-precision epoch timestamp in its first 48 bits, making it both unique and time-sortable.
- JSON Formatter — pretty-print API responses that contain epoch timestamps so you can spot and convert them quickly.
- JWT Decoder — decode tokens and see
iat,exp, andnbfepoch claims in human-readable form.