How to Convert a Unix Timestamp to a Date

A Unix timestamp encodes an instant. The timezone determines how that instant looks on a clock, and the unit determines its numeric value.

Identify seconds or milliseconds first

To convert a Unix timestamp to a date, determine whether it is in seconds or milliseconds since 1970-01-01 00:00:00 UTC. Multiply seconds by 1,000 if your date API expects milliseconds. Divide milliseconds by 1,000 if your system expects seconds, preserving or rounding the fractional part as its contract requires.

For example, 1700000000 seconds and 1700000000000 milliseconds both represent 14 November 2023, 22:13:20 UTC. The numbers represent the same instant, but feeding seconds to a millisecond API without converting them gives the wrong date.

Try the free Timestamp Converter

Paste the number into the timestamp field. The widget displays a local date and a UTC date for the detected instant. It also provides the reverse direction: select a local date and time, then read the epoch seconds and milliseconds.

The current widget uses a magnitude heuristic: an absolute value greater than 99,999,999,999 is treated as milliseconds; smaller absolute values are treated as seconds. This is convenient for many current timestamps, but early millisecond values and unusual dates can be misclassified. Confirm the unit from the original API rather than relying on digit count alone.

Try Timestamp Converter

If the preview does not load, open Timestamp Converter and customize it.

Work through a UTC example

In JavaScript, the Date constructor expects epoch milliseconds for a numeric argument. Try these two expressions in a trusted console:

new Date(1700000000 * 1000).toISOString()
new Date(1700000000000).toISOString()

Both yield 2023-11-14T22:13:20.000Z. The Z suffix denotes UTC. For a UTC+02:00 offset at that instant, the local time would be 15 November at 00:13:20. A device in another timezone will show a different local clock time but the same underlying instant.

See the JavaScript Date reference for millisecond and timezone interpretation.

Convert a local date back into epoch time

Choose a date and time in the reverse panel. It interprets that input in the browser's local timezone and reports milliseconds and whole seconds. Use a trusted timezone-aware conversion if the original input belongs to another timezone or falls near a clock change.

The Now control sets the timestamp panel to current epoch seconds and the reverse date field to the current local minute. These values can differ by the seconds since that minute began; do not treat Now as a full-precision round-trip test.

Avoid common timestamp mistakes

  • Check seconds versus milliseconds from the source contract, especially near the epoch.
  • Keep UTC and local representations clearly labeled when debugging distributed systems.
  • Do not assume an unqualified local date string represents UTC.
  • Check invalid values and negative timestamps representing dates before the epoch.

Use the customization page to set appearance, size and accent, then copy the link into a Notion /embed block. Date calculations are browser-side, but hosted assets must load. The tool does not synchronize a Notion database or guarantee trusted clock accuracy.

Common questions

Is a Unix timestamp tied to a timezone?

The timestamp describes an instant; formatting it as a civil date depends on the timezone.

How do I convert milliseconds to seconds?

Divide by 1,000. Decide how to handle fractions based on the receiving API.

Will the widget always detect the correct unit?

No. The current magnitude rule can misclassify small millisecond timestamps. Verify units independently.