Developer

Unix Time Explained: Seconds, Milliseconds and Time Zones

ToolOrbit Engineering 2 min readUpdated
Unix Time Explained: Seconds, Milliseconds and Time Zones

A Unix timestamp is the number of seconds that have elapsed since midnight UTC on January 1, 1970, known as the epoch. It is the lingua franca of computers for representing a moment in time, but it is unreadable to humans. The ToolOrbit Unix Timestamp Converter translates between epoch numbers and clear dates in local, UTC, and ISO formats.

Seconds versus milliseconds

This is the most common source of confusion. Many systems, including most Unix tools and databases, use seconds. JavaScript's Date.now() and many APIs use milliseconds, which are 1000 times larger. A ten-digit number is almost certainly seconds; a thirteen-digit number is milliseconds. The converter auto-detects the unit so you do not have to guess.

1719619200  (seconds)      -> 2024-06-29 00:00:00 UTC
1719619200000 (milliseconds) -> same instant

ISO 8601: 2024-06-29T00:00:00Z

Time zones and formats

  • Local: the date as it appears in your own time zone, including daylight saving
  • UTC: the universal reference with no offset, ideal for logs and storage
  • ISO 8601: the standard machine-readable string with a Z or numeric offset
  • Always store and transmit timestamps in UTC, and convert to local only for display
Tip: The epoch is always UTC. A timestamp itself has no time zone; the offset only matters when you format it for a human to read.

Using the converter

Paste a timestamp to see it expanded into every format at once, or enter a human date to get the epoch value back. There is a one-click option to grab the current timestamp, handy for testing or seeding data. Everything is computed in your browser, so nothing you paste is sent anywhere.

Best practices

Be explicit about units in your APIs and database columns to avoid the seconds-versus-milliseconds trap. Keep timestamps in UTC end to end, and reserve local formatting for the final moment a value reaches a person. Watch for the year 2038 limit on 32-bit signed timestamps in older systems.

Timestamps you should recognize on sight

A few epoch anchors
TimestampUTC timeVibe
16094592002021-01-01 00:00:00New year
16725312002023-01-01 00:00:00Monotonic SaaS debut
17356896002025-01-01 00:00:00Recent
17525376000002025-07-15 00:00:00 (ms)Thirteen-digit surprise

If a date imports as 1970 or as years earlier than expected, the two usual suspects are milliseconds (thirteen digits) where seconds (ten) were expected, and seconds treated as milliseconds. Anchoring on a few recent Januaries makes both errors visible in a glance. And plan ahead: 32-bit epoch time wraps in 2038 (the “Year 2038 problem”) for systems still storing it as 32-bit integers.


Tools mentioned

More reading

View all guides
What Is Base64? How Encoding Works and Common Mistakes
Developer

What Is Base64? How Encoding Works and Common Mistakes

What Base64 encoding actually does, where it is used, and the mistakes that cause broken or oversized output.

2 min readUpdated
encodeURI vs encodeURIComponent: Which One to Use
Developer

encodeURI vs encodeURIComponent: Which One to Use

How percent-encoding works, the difference between encoding a whole URL and a single component, and the mistakes that break links.

2 min readUpdated
What Is a UUID? Version 4 vs Version 7 Explained
Developer

What Is a UUID? Version 4 vs Version 7 Explained

What a UUID looks like, why version 4 is the safe default, when version 7 is better, and best practices for IDs.

2 min readUpdated
How SHA-256 and SHA-512 Hashes Work: Hashing vs Encryption
Developer

How SHA-256 and SHA-512 Hashes Work: Hashing vs Encryption

What a hash function does, how to choose between SHA-256 and SHA-512, and why hashing is not encryption.

2 min readUpdated
What Is a JWT? Header, Payload and Signature Explained
Developer

What Is a JWT? Header, Payload and Signature Explained

A JSON Web Token has three parts. Learn what the header, payload and signature contain, how to read the claims, and why decoding is not verifying.

2 min readUpdated
What Is HTML Encoding? Entities & Escaping Explained
Developer

What Is HTML Encoding? Entities & Escaping Explained

Learn how HTML encoding works, why escaping prevents XSS and layout breaks, and how to encode and decode named, decimal, and hex entities.

2 min readUpdated
Binary, Octal, Decimal and Hex: How Number Bases Work
Developer

Binary, Octal, Decimal and Hex: How Number Bases Work

How positional number bases work, why very large values need exact arithmetic, and the hex and binary values you meet every day.

2 min readUpdated
Regex Basics: How Patterns, Flags and Character Classes Work
Developer

Regex Basics: How Patterns, Flags and Character Classes Work

How a regular expression is built, what the flags change, and the character classes you will use most.

2 min readUpdated