THE PRACTICAL GUIDE

Reproduce Unix timestamp units and timezone conversions

Compare seconds and milliseconds for one instant, verify an explicit timezone offset, and reproduce the errors caused by a wrong unit or invalid calendar date.

Start from a fixed instant and a recorded test

We checked the fixtures below on November 15, 2026 using Node v22.23.4 and ADEMN’s timestamp conversion functions. All four presets resolve to January 1, 2024 at midnight UTC. Inputs are synthetic so that you can reproduce the results without using a private log or customer event.

Open Unix Timestamp Converter and load a named example. Each button sets the direction, input, unit, and timezone mode, then clears the previous result. Select Convert to compare its ISO output with the expected value. Editing an input or changing the unit clears the example selection and result.

Unix seconds
Direction: timestamp-to-date
Input: 1704067200
Unit: seconds
Timezone mode: utc
Expected ISO: 2024-01-01T00:00:00.000Z
Unix milliseconds
Direction: timestamp-to-date
Input: 1704067200000
Unit: milliseconds
Timezone mode: utc
Expected ISO: 2024-01-01T00:00:00.000Z
UTC date
Direction: date-to-timestamp
Input: 2024-01-01T00:00:00
Unit: seconds
Timezone mode: utc
Expected ISO: 2024-01-01T00:00:00.000Z
Date with −05:00 offset
Direction: date-to-timestamp
Input: 2023-12-31T19:00:00-05:00
Unit: seconds
Timezone mode: local
Expected ISO: 2024-01-01T00:00:00.000Z

Change the unit and the digits together

The seconds preset uses 1704067200; the milliseconds preset uses 1704067200000. Multiplying seconds by 1,000 preserves the instant while changing the unit. Loading the two presets reproduces the same ISO result, Unix seconds, and Unix milliseconds.

To reproduce the wrong-unit case, load Unix seconds and change Timestamp unit to Milliseconds without changing the digits. The ISO result becomes 1970-01-20T17:21:07.200Z. The input is still a valid timestamp, so syntax validation cannot identify the intended unit. Check the producing system’s field definition when investigating an unexpected date.

Recorded unit comparison
DigitsSelected unitISO output
1704067200Seconds2024-01-01T00:00:00.000Z
1704067200000Milliseconds2024-01-01T00:00:00.000Z
1704067200Milliseconds1970-01-20T17:21:07.200Z

Separate a UTC instant from its local representation

Load Date with −05:00 offset. The input 2023-12-31T19:00:00-05:00 describes the same instant as 2024-01-01T00:00:00Z. Its explicit offset takes precedence over the selected timezone mode. Both produce 1704067200 seconds and 1704067200000 milliseconds in the recorded test.

The Local date row uses your browser’s timezone and can therefore differ between computers. The ISO output and timestamp remain the reproducible comparison. For a date without Z or an offset, choose UTC or Local timezone deliberately. A log entry containing only a local clock reading needs its timezone context to identify an instant.

An independent JavaScript check with an explicit offset
new Date("2023-12-31T19:00:00-05:00").toISOString();
// "2024-01-01T00:00:00.000Z"

Reproduce invalid and ambiguous inputs

Enter 1704067200.5 in timestamp mode to see the whole-number requirement. Use milliseconds for subsecond precision. In date mode, 2023-02-29T00:00:00 fails calendar validation because 2023 has no February 29. A date-only value such as 2024-01-01 also needs a time before this converter will interpret it.

When a local timezone observes daylight saving, some clock readings do not exist and others occur twice. ADEMN rejects nonexistent local times and selects the earlier occurrence of a repeated local time. Include the actual offset when you need to distinguish the repeated occurrences. Keep that offset and the original input unit with any bug report.

Verify the receiving system’s representation

Copy the result only after checking the field label. A seconds field and a milliseconds field can accept integer text while representing very different instants. Check a known event on both sides of an import, and compare ISO values with explicit offsets when inspecting logs from different systems.

The downloadable record contains these fixed outputs and the tested environment. Browser conversion runs locally and clears on reload. A useful correction report includes the selected direction, unit, timezone mode, a synthetic input, and the expected ISO output.

Methods and references

Put it into practice