How to convert Unix timestamps between seconds, milliseconds, and UTC

Use TinyToolbox to read an epoch timestamp or convert a dated ISO value, and diagnose unit and time zone mismatches.

Open the tool

A log shows 1704067200000, and a service response shows 1704067200. The two numbers look different but can describe the same instant. The longer one counts milliseconds, and the shorter one counts seconds. If you pick the wrong unit, the resulting date may still look valid even though it is far from the time you expected.

TinyToolbox Unix Timestamp Converter converts epoch seconds or milliseconds into UTC and converts a dated ISO timestamp with an explicit offset back to epoch time. It displays all three forms together. Start with the units documented by the source, then compare the resulting instant against the event you were trying to locate.

Identify the source units before converting

Unix timestamps measure elapsed time relative to 1970-01-01T00:00:00Z. A value of zero represents that instant. Negative values represent instants before it. The timestamp itself needs a unit. A service can use seconds, milliseconds, or a finer unit such as microseconds. TinyToolbox has separate input modes for seconds and milliseconds.

Look up the field’s definition in the producing application or inspect how its value was created. For an ordinary date near the present, a 10-digit integer is often seconds and a 13-digit integer is often milliseconds. This is a clue, because shorter values can appear for older dates or for small test fixtures. A value of 1000 means one second after the epoch if it is measured in milliseconds and sixteen minutes and forty seconds after the epoch if it is measured in seconds.

A numeric value can also represent a duration rather than an instant. If a performance log reports 250 ms elapsed, converting that value to a date would place it near the epoch without telling you when the measurement happened. Check whether the source means “time since 1970” or “time since the start of this operation.”

Convert an epoch value in TinyToolbox

  1. Open Unix Timestamp Converter.
  2. Paste the numeric value under Input text.
  3. Choose Epoch seconds to UTC or Epoch milliseconds to UTC under Conversion.
  4. Select Run tool.
  5. Compare the UTC timestamp and the two epoch values in Result. Select Copy result if you need to keep them for reference.

The tool runs in your browser and expects a number without thousands separators or a unit suffix. Enter 1704067200, for example, without commas or the trailing letter s. The numeric modes accept negative numbers and decimals. Output is based on the browser’s millisecond date representation, so fractional precision finer than one millisecond does not carry through.

For a quick check, convert 1704067200 as seconds. You should see:

2024-01-01T00:00:00.000Z
Epoch seconds: 1704067200
Epoch milliseconds: 1704067200000

Then enter 1704067200000 in the milliseconds mode and verify that you get the same UTC value. The explicit labels let you choose the number to copy into the next system. An API that expects seconds will interpret a milliseconds value differently even though both appear in the same result.

Convert a date with an explicit offset

Use ISO date to epoch when you start with a calendar date and time. Include a date, time, and zone indicator. A value ending in Z is already in UTC. An offset such as +05:30 describes how far the written local clock is ahead of UTC. The offset ensures that two people running the same example can identify the same instant from different time zones.

Try converting 2024-01-01T05:30:00+05:30. The result should be 2024-01-01T00:00:00.000Z and the same epoch values as in the previous example. At a positive offset, subtract the offset from the written local time to find UTC. A negative offset moves the corresponding UTC clock later.

A conversion can cross midnight. For example, 2024-01-01T00:15:00+05:30 corresponds to 2023-12-31T18:45:00.000Z. The UTC date moves to the previous day. If you are checking which local calendar day an event belongs to, use the local date for that question and retain the UTC time for comparing instants.

The tool requires a trailing Z or an offset written with a colon. A timestamp such as 2024-01-01T05:30:00 does not provide enough information for this mode. Find the intended zone and supply the actual offset for that date. A named time zone can observe seasonal changes, so use a time zone-aware source to look up its offset at the relevant instant rather than guessing from today’s offset.

Work through a log mismatch

Suppose a local test records that an import started at 2024-01-01T00:00:00Z. One log prints 1704067200, and another prints 1704067200125. Convert the first number as seconds and the second as milliseconds. The first should show midnight on the dot. The second should show 2024-01-01T00:00:00.125Z, or 125 milliseconds later.

This is a more useful comparison than comparing the raw digit counts. Once the units are aligned, you can decide whether the second event really followed the first by the expected interval. If the log lacks a unit label, inspect the logger or data contract. Changing the unit until the date looks plausible may help diagnose the issue, but verify how the value was produced before recording a conclusion.

If one system drops fractional seconds, several events recorded within the same second can appear to share a timestamp. Use the most precise source available when ordering them. Check other fields such as a sequence number if timestamp precision alone cannot establish which event came first.

Check negative values and fractional seconds

A signed timestamp is useful in tests around the epoch boundary. For example, -1 in the seconds mode should yield 1969-12-31T23:59:59.000Z. In the milliseconds mode, -1 gives 1969-12-31T23:59:59.999Z. Keep the negative sign when comparing results. Removing it puts the instant on the opposite side of the boundary.

A fractional seconds value such as 0.125 produces 1970-01-01T00:00:00.125Z and 125 milliseconds. A source that provides microseconds or nanoseconds needs a separate conversion before using the tool. For a high-precision comparison, preserve the original integer and convert only a copy for display. Dividing to milliseconds discards precision your later workflow may need.

If a timestamp is unusually large or small, the browser may reject it as outside its date range. Check the unit and whether you copied the entire value. A 16-digit timestamp might be measured in microseconds rather than milliseconds. A suffix such as ms can also trigger an input error. Remove it only after using it to identify the correct mode.

Verify the final value before using it

Copy only the unit required by the destination. If you paste the entire result into a field that expects a number, the label and UTC string can cause an error. For a JSON payload, check whether the destination expects a numeric timestamp or an ISO string. If a numeric value belongs to a specified unit, keep that unit in your test documentation as well.

When troubleshooting shared logs, write down both the original value with its unit and the converted UTC value. If a person needs to read the event in a local time zone, include that time and its offset as a separate representation. This preserves enough information to reproduce the comparison later. The conversion is ready for use when the unit, instant, and expected precision all match the receiving workflow.

Compare exports from systems with different clock formats

Imagine an order system exports the timestamp 1735689600, while a warehouse report shows 2024-12-31T19:00:00-05:00. The order system documents epoch seconds. Convert its number using Epoch seconds to UTC and write down the UTC output. Then switch to ISO date to epoch and enter the full warehouse timestamp, including the minus sign in the offset. Both conversions point to 2025-01-01T00:00:00.000Z, or 1735689600000 epoch milliseconds.

That establishes that the two values describe the same instant. It does not establish that they refer to the same event. Compare a stable event or order ID before merging rows in a report. Multiple records can share one timestamp, especially when a system only stores whole seconds. Keep the original timestamp and unit in your working file if you need to trace an imported row back to its source.

The different calendar dates in this example can also explain a difference in daily totals. A warehouse operating at the recorded local offset can include the event under 31 December, while a UTC report includes it under 1 January. Decide which calendar and zone define the reporting period before comparing totals. Converting both timestamps to UTC helps compare their ordering. Reporting by local business day is a separate step.

Diagnose a value that lands near 1970

Suppose a service reports that a record was updated at 1735689600. You convert it as milliseconds and see a date in January 1970. Check the field’s documentation before making changes to the data. If the field actually uses seconds, the digits themselves can be correct. Select the seconds mode and convert again. If it is a test record designed to represent a date close to the epoch, the first result might already be right.

A large year can signal the inverse problem. If 1735689600000 is documented as milliseconds and interpreted as seconds, the converted instant moves far beyond the expected date. Match the unit explicitly when preparing an API request, database migration, or test fixture. Prefer names like created_at_ms where you control a schema and the convention fits. If you do not control the schema, keep the unit in a field description or test record.

Check the input and output at each boundary. A system may receive seconds and store milliseconds, or display an ISO timestamp after reading a database field. A fault can occur when the value is converted twice or when no conversion happens. Compare a known test event at each step. Use the same event identifier each time so a later retry cannot be mistaken for the original update.

Preserve the distinction between an offset and a time zone

An explicit offset tells you how to convert the written clock time for one instant. To see its effect, compare 2025-01-15T09:00:00-05:00 with 2025-07-15T09:00:00-04:00. The first becomes 14:00 UTC on 15 January and the second becomes 13:00 UTC on 15 July. Both begin at 09:00 as written. The supplied offsets are one hour apart, so the UTC clock readings differ by an hour as well.

For a recurring 09:00 event, establish the proper offset for each date using the event’s time zone rules. Enter that offset with the date when converting a specific occurrence. Copying the first offset into all later timestamps would apply it even on dates when the event is meant to follow a different offset. If a source gives a local date and time without an offset, obtain the location or zone and enough context to resolve the intended instant before entering it.

When the same local clock time can occur more than once on a clock-change date, a source’s explicit offsets can distinguish the two instants. If two records have identical written times and different offsets, convert each complete timestamp. Compare the numeric epoch values to see which event came first. If an export dropped the offsets, copying the visible times into the converter cannot restore the missing distinction.

Check the precision the destination can hold

If an event occurs at 2025-01-01T00:00:00.125Z, keep the fractional component when you copy the result to a destination that accepts milliseconds. A destination that stores only whole seconds needs a stated rounding or truncation rule. Several events that occurred within the same second may end up with the same stored value. Use a separate sequence or event ID if those events still need to stay distinguishable.

After mapping a timestamp field, convert a sample back to UTC and compare it with the original. Use at least one sample with a nonzero fractional part when the source supports it. For a workflow that handles dates before 1970, check a negative sample too. Recording these expected results gives you a quick way to spot a change in units or precision if the import format changes later.