Dev Converters
Time

Unix Timestamp Converter

Convert Unix timestamps (seconds or milliseconds) to human-readable dates and back. Displays UTC and local time side by side.

How it works

A Unix timestamp is the number of seconds elapsed since 1970-01-01T00:00:00Z, the "epoch". It is a compact, timezone-free representation of an instant in time, and it is used everywhere — from database columns to API responses to log files. The tricky part is that different systems use different units: seconds (classic Unix) vs milliseconds (JavaScript, Java) vs microseconds (some high-resolution APIs).

This tool auto-detects the unit by looking at the magnitude. Values up to roughly 10 digits are interpreted as seconds (those cover dates out to the year 2286), longer values as milliseconds. Scientific notation and decimal fractions are also accepted. If the input looks like a date string, the tool parses it and produces the reverse conversion.

Common gotchas: the legendary Y2038 problem will hit 32-bit `time_t` systems in January 2038, so always store timestamps in at least 64 bits. Leap seconds are not counted in Unix time — an entire leap second gets smeared or repeated. For business logic, store the epoch and compute the display format per user; never store timezone-bound strings in a database.

Frequently asked questions

How does the tool know if the input is seconds or milliseconds?
By magnitude. Numbers ≤ 10 digits are treated as seconds, longer as milliseconds. You can also paste an ISO date string to go the other direction.
Can I convert a date back to a timestamp?
Yes. Paste any ISO 8601 string (e.g., "2024-01-01T00:00:00Z") and the output shows the corresponding epoch in both seconds and milliseconds.
What about timezones?
The tool displays UTC and your browser local time. It does not currently support arbitrary named zones like America/New_York.

Related tools