BBoltlyze

Unix Timestamps: Seconds, Milliseconds and Time Zones

Published · Updated · 5 min read

A timestamp is only useful when the sender and receiver agree on its unit and time zone. A number with ten digits is often Unix seconds and one with thirteen digits often milliseconds, but digit count is a convention, not a reliable format declaration. Check the API schema or database field first.

Start with the contract, not the number of digits

Unix time counts from 1970-01-01T00:00:00Z. Many APIs express this count in seconds; JavaScript's Date.now() returns milliseconds. This difference is a factor of 1,000.

For example, both 1700000000 seconds and 1700000000000 milliseconds represent 2023-11-14T22:13:20.000Z. In the Boltlyze timestamp converter, enter each value and compare the UTC output. Then confirm the unit against the API documentation rather than relying on the converter's magnitude rule.

The converter treats positive values above 9,999,999,999 as milliseconds and smaller positive values as seconds. This is a practical heuristic for common contemporary data, not a standard. It misclassifies sufficiently distant future values expressed in seconds. If you control an API, make the unit explicit in the field name or schema, such as created_at_ms or an ISO 8601 string with an offset.

Keep UTC instants separate from local wall-clock input

A Unix timestamp identifies an instant. The same instant can display as different local clock times in different time zones. The converter shows a local display and UTC ISO 8601 value so you can compare them. For logs and API debugging, use UTC as the stable reference.

A datetime-local input contains a date and clock time but no time-zone offset. The browser interprets it in the device's local time zone when converting it to a timestamp. During a daylight-saving transition, a local clock time may be skipped or repeated. If the input represents a real event in another region, collect an explicit zone or offset instead of assuming the user's device zone.

Check dates near the epoch and far in the future

This tool's timestamp-to-date view accepts positive values whose interpreted UTC year is 1971 through 2999, regardless of the browser's local time zone. For example, 31536000 is 1971-01-01T00:00:00Z and is accepted even where the local time still falls on December 31, 1970. Date-to-timestamp can produce negative numbers for pre-epoch dates even though the reverse view does not display negative timestamps. A UTC timestamp in 1970 is outside the converter's display rule. These are implementation limits, not limits of the Unix time concept.

For calendar intervals such as days between two dates, use the date calculator; elapsed timestamps and calendar dates answer different questions. For repeatable debugging, save the original API value, its documented unit, the UTC conversion and the local time zone used for any local-date input.

Quick checklist

  1. Read the API's documented timestamp unit.
  2. Convert the value and compare the UTC output with an independently known event time.
  3. Record the local time zone when converting a wall-clock date-time.
  4. Check daylight-saving ambiguity for dates near a clock transition.
  5. Keep the source value and unit alongside logs so later readers do not have to guess.

The converter processes the entered value in the browser. A limited usage event may report the tool ID, timing and success status, but not the timestamp or date. See the Privacy Policy for separate analytics and advertising data flows.

Tools used in this guide

More guides