How to convert a Unix timestamp

Unix time counts elapsed time from 1970-01-01 at 00:00:00 UTC, so correct conversion depends on the input unit and an explicit timezone for date text.

Open the Unix Timestamp Converter

Unix seconds and milliseconds

Many systems store Unix time as whole seconds, while JavaScript and some APIs use milliseconds. Confusing the two changes the magnitude by 1,000 and often produces a date near 1970 or far outside the expected range.

1704067200 seconds = 2024-01-01T00:00:00Z

1704067200000 is the same instant in milliseconds.

How to convert a Unix timestamp

  1. Choose Unix seconds, Unix milliseconds, or ISO date with timezone.
  2. Choose whether to display UTC only or UTC and the browser timezone.
  3. Enter the timestamp or date.
  4. Select Convert timestamp.
  5. Copy the result with its unit and timezone label.

Converting a date back to Unix time

Use an ISO date that includes seconds and either Z or a numeric UTC offset. For example, 2024-01-01T02:00:00+02:00 is the same instant as midnight UTC.

Bare local dates such as 2024-01-01 02:00 are ambiguous. The ToolPixels converter rejects them instead of guessing a timezone.

UTC and local display

ValueMeaning
Unix timestampAn instant independent of local timezone
UTC displayThe instant shown at offset +00:00
Browser displayThe same instant using device timezone rules

Changing the display timezone does not change the instant. It only changes the calendar representation.

Timestamp conversion pitfalls

  • Check whether a 10-digit value is seconds and a 13-digit value is milliseconds, but confirm with documentation.
  • Include an offset in every input date.
  • Expect daylight-saving offsets to vary by date.
  • Do not expect leap-second support from ordinary browser date APIs.
  • Remember that browser timezone output depends on the device settings.

Open the ToolPixels tool

Convert Unix seconds, milliseconds, and explicit-offset ISO dates locally with UTC always shown.

Convert a timestamp