Skip to content
Runs in browserNothing is uploaded

Unix Timestamp Converter

Turn a human date into the integer an API, database, or log uses, or turn an epoch value back into a readable UTC date. The seconds-versus-milliseconds switch is explicit because multiplying the wrong unit by 1,000 is one of the most common timestamp bugs. Choose the current time for a quick reference, or enter a date and see the result immediately in this browser tab.

Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.

Add to Chrome — free
Result

What it does

  • Date to Unix timestamp conversion
  • Unix timestamp to UTC date conversion
  • Explicit seconds or milliseconds mode
  • Current time shortcut for debugging
  • No request or server-side storage

How to use Unix Timestamp Converter

  1. 1

    Choose a direction

    Select Date to timestamp when preparing an API value, or Timestamp to date when inspecting a log, database row, or token claim.

  2. 2

    Confirm the unit

    Choose seconds for the usual ten-digit Unix value or milliseconds for the thirteen-digit JavaScript and many database values.

  3. 3

    Enter the value

    Pick a local date and time or paste the numeric timestamp. The output includes the UTC interpretation so local timezone assumptions are visible.

  4. 4

    Copy what you need

    Copy the first output line into code or a test case. Keep the UTC line nearby when documenting what the number means.

How it works

The date picker produces a JavaScript Date, which represents a number of milliseconds since the epoch. Seconds mode divides that number by 1,000 and floors it because Unix timestamps in seconds do not carry fractional milliseconds. Milliseconds mode keeps the original integer. The reverse operation multiplies seconds by 1,000, constructs a Date, and formats it with toISOString, making the UTC timezone explicit rather than inheriting the reader's locale.

The converter does not parse ambiguous natural-language phrases such as “next Friday” or silently assume a timezone for a date-only string. The visible date picker supplies a timezone-aware local instant. Numeric input is checked for finiteness and for a valid JavaScript date range before it is displayed, so a typo becomes a visible error rather than an apparently plausible year.

When developers use it

Timestamp conversion is useful while debugging event logs, checking expiry claims, preparing seed data, comparing browser and API output, and translating a database value into a date a human can discuss. It is also a quick way to spot a unit mismatch: a timestamp that lands thousands of years away is usually a seconds-versus-milliseconds mistake.

The result is an interpretation, not a validation of business logic. A timestamp can be perfectly formatted and still be expired, in the wrong field, or generated by a machine with a bad clock. Use the UTC line as documentation and let the receiving application decide whether the value is acceptable.

Telling seconds from milliseconds at a glance

The unit mismatch is the most common timestamp bug and the easiest to spot once you know what the numbers look like.

A current timestamp in seconds is ten digits and starts with 17. The same instant in milliseconds is thirteen digits. That is the whole test: count the digits. Ten means seconds, thirteen means milliseconds, and anything else deserves suspicion.

The two classic wrong answers are recognizable too. Feed a seconds value to something expecting milliseconds and you land in January 1970, because you have described a moment about twenty days after the epoch. Feed a milliseconds value to something expecting seconds and you get a date somewhere around the year 56,000. Both are so far from plausible that they are easy to catch — which is the good case.

The dangerous case is a timestamp in a unit that is merely wrong rather than absurd: microseconds (sixteen digits) and nanoseconds (nineteen) both appear in tracing and database systems, and dividing one by a thousand too few times gives a date that looks like a real date. If a value comes from an unfamiliar system, convert it before assuming, and check that the result is near today.

Unix time also has no concept of leap seconds — the same value is repeated across one, so a Unix timestamp is not a count of elapsed seconds since 1970. It does not matter for scheduling and does matter for precise interval arithmetic.

The 2038 problem is still real in some places

A signed 32-bit integer runs out on 19 January 2038, at which point it wraps to December 1901.

This is not a concern for JavaScript, which stores timestamps as a double, or for any modern 64-bit system. It is a live concern in three specific places: embedded devices and firmware that will still be running in a decade, database columns explicitly typed as a 32-bit integer, and file formats or protocols with a fixed four-byte time field.

It is worth checking now rather than then, because the failure arrives early. Anything that computes an expiry date, a retention period, or a maturity date more than a decade ahead is already producing 2038-range values today. A subscription system that offers a twenty-year term is doing this arithmetic in the present, and a wrapped date usually surfaces as a record that looks expired rather than as an obvious crash.

If you own a schema, check the column type on anything storing a time as an integer. Sixty-four bits costs four extra bytes and removes the question entirely.

Examples

Convert a UTC New Year timestamp

2024-01-01 00:00:00 UTC
1704067200

This is the conventional ten-digit seconds value. The same instant expressed in milliseconds is 1704067200000, which is why the unit selector must be part of the conversion.

Read a JavaScript timestamp

1704067200000 milliseconds
2024-01-01 00:00:00 UTC

JavaScript Date.getTime returns milliseconds, so interpreting this number as seconds would point far beyond the useful date range rather than at the start of 2024.

Frequently asked questions

What is Unix time measured from?

Unix time counts elapsed seconds from 1970-01-01 00:00:00 UTC, commonly called the Unix epoch. It does not include a timezone offset in the number. A local date is converted to its corresponding instant first, which is why the same wall-clock time in two timezones produces different numeric values.

Should I use seconds or milliseconds?

Use seconds when an API, JWT claim, shell command, or protocol specifies Unix time in seconds. Use milliseconds for JavaScript Date values and systems that document millisecond precision. A useful visual clue is length: seconds are usually ten digits today, while milliseconds are usually thirteen, but always follow the receiving system's contract.

Why is my timestamp one or more hours different?

Unix timestamps represent an instant in UTC, while a date picker displays local time. The converter shows the UTC interpretation deliberately. Daylight-saving rules and the browser's timezone can move the displayed local clock even though the timestamp itself is correct and unchanged.

Does the current-time button use the server clock?

No. It reads the clock on your device through the browser's Date API. That is useful for reproducing what your local machine will send, but it is not an authoritative time service. If clock accuracy matters for an audit or signed event, compare it with the system that will actually accept the timestamp.