Unix Timestamps: Seconds vs. Milliseconds
A Unix timestamp represents an instant as a numeric offset from the Unix epoch. One of the most common conversion mistakes is confusing seconds with milliseconds. The numeric value may look plausible in both cases, but the wrong unit produces a very different date.
What a Unix timestamp represents
The Unix epoch is 1970-01-01 00:00:00 UTC. A Unix timestamp counts elapsed time from that reference point. The timestamp identifies an instant; it does not permanently store a local calendar time or a time-zone label.
Two devices can display the same timestamp using different local date and time values because each device may use a different time zone. The underlying instant remains the same.
Seconds and milliseconds
Unix timestamps are commonly shared in seconds, while JavaScript Date values use milliseconds. A millisecond is one thousandth of a second, so the two forms differ by a factor of 1,000.
The same instant in two units
Seconds: 1700000000
Milliseconds: 1700000000000| Unit | Example | Conversion to milliseconds |
|---|---|---|
| Seconds | 1700000000 | Multiply by 1,000 |
| Milliseconds | 1700000000000 | Already in milliseconds |
How to convert between the units
To convert seconds to milliseconds, multiply by 1,000. To convert milliseconds to seconds, divide by 1,000. When a tool or API expects one unit, make sure the value is converted before it is passed in.
When creating a seconds timestamp from a selected date and time, the KitDevTools converter uses a whole-second value. Millisecond output keeps the millisecond value supplied by the browser Date object.
Conversion formulas
milliseconds = seconds × 1000
seconds = milliseconds ÷ 1000UTC, local time, and displayed dates
The Unix timestamp is based on UTC, but a human-readable display may use a local time zone. The KitDevTools Timestamp Converter displays the converted date using the browser device's local time zone. Its date-time input also represents local date and time.
The tool does not include a separate UTC or arbitrary time-zone selector. If you compare results from devices in different locations, the displayed clock time may differ while the timestamp still represents the same instant.
- Check whether the source value is in seconds or milliseconds.
- Record the time zone when sharing a human-readable date and time.
- Use UTC consistently when a system specification requires UTC.
- Do not compare local clock strings without first accounting for their time zones.
Common places timestamps appear
When a timestamp appears implausibly early or late, first verify the unit before assuming the source date is wrong.
- API responses and event payloads.
- Application logs and monitoring data.
- Database records that store event times numerically.
- Scheduled jobs and integration workflows.
- Debugging situations where a date appears far in the past or future because the wrong unit was used.
