$ exec portfolio-nav

$ exec epoch

Epoch & Unix Timestamp Converter

Paste any Unix timestamp — in seconds, milliseconds, microseconds, or nanoseconds — and see it as ISO-8601, UTC, your local time, and a relative “in 3 hours” phrase.

karthick@portfolio — epoch — zshReady
From the input field, press Enter to run.

output will appear here.

$ cat about.md

A Unix epoch timestamp is the number of time units that have elapsed since 1970-01-01 00:00:00 UTC. Different systems use different units: classical Unix uses seconds (10 digits today), JavaScript and most newer APIs use milliseconds (13 digits), Java’s Instant.toEpochMilli matches that, and high-resolution telemetry can be in microseconds (16 digits) or nanoseconds (19 digits). Mixing units is one of the most common bugs in date handling — a 1000× error is silent and easy to miss.

This converter inspects the number of digits and auto-detects which unit you meant, then shows the resulting moment in three forms: ISO-8601 (the safest interchange format), UTC (for log correlation), and your browser’s local time (for human reading). It also computes a relative phrase such as “2 hours ago” or “in 14 minutes” so you can sanity-check whether a timestamp is fresh.

The tool also handles the reverse direction: type a date in any format the JavaScript Date parser understands (ISO-8601, RFC 2822, common locale formats, or the literal “now”) and it returns the epoch in all four units, so you can paste it straight into your code or query without worrying about which unit your downstream system expects.

$ ls examples/

Seconds (10 digits)1700000000

Classic Unix timestamp in seconds.

Milliseconds (13 digits)1700000000000

JavaScript / Java Instant style.

ISO date to epoch2026-04-18T12:00:00Z

Reverse direction — date string to epoch units.

Right nownow

Returns the current epoch in all four units.

$ man --faq

Q.How does it know whether my number is seconds or milliseconds?

A.By digit count. 10 digits is treated as seconds, 13 as milliseconds, 16 as microseconds, 19 as nanoseconds. This works for any timestamp from roughly 2001 onwards.

Q.What about timezones?

A.Epoch timestamps have no timezone — they are absolute. The converter shows UTC, ISO-8601, and your browser’s local time so you can read whichever you need.

Q.Will Unix time break in 2038?

A.Only for systems that store the timestamp as a signed 32-bit integer (Y2K38). Most modern systems use 64-bit integers and are safe for hundreds of billions of years.

Q.Can I paste a relative date like “tomorrow”?

A.No — only formats that Date.parse understands plus the literal “now”. For richer parsing, copy from a tool like dayjs and paste the resulting ISO string.

Q.Why am I getting a date in 1970?

A.You probably pasted a value in seconds while your code expects milliseconds (or vice versa) — multiplying or dividing by 1000 fixes it. The auto-detection in this tool prevents this when you paste directly.

$ Privacy: this tool runs entirely in your browser. Your input is never sent to a server, never logged, and never stored. ← back to all tools