Unix timestamps: seconds vs milliseconds, with examples
A timestamp can look like an ordinary integer while representing very different dates depending on its unit. Before converting a log entry or an API field, find out whether the producer uses seconds or milliseconds. The value alone is not a complete specification.
The same instant in two units
| Representation | Value |
|---|---|
| ISO UTC | 2026-01-01T00:00:00Z |
| Unix seconds | 1767225600 |
| Unix milliseconds | 1767225600000 |
Try the first integer with Seconds → date, then the second with Milliseconds → date. Both produce the same UTC result. Giving the seconds value to the milliseconds conversion produces a date near the beginning of 1970 instead.
Why the digit-count shortcut is imperfect
Contemporary Unix seconds often have 10 digits and contemporary milliseconds often have 13. That is a useful clue, not a validation rule. Older dates, far-future dates and negative timestamps break the shortcut. Check the API documentation or ask the system producing the value. ToolDock makes you choose the unit rather than silently guessing it.
UTC and local time are different displays
The UTC and local lines refer to one instant. The local display depends on your device timezone, including applicable daylight-saving rules. A colleague in another country may see a different clock time without either conversion being wrong. JavaScript dates store time relative to the epoch in milliseconds; the MDN Date reference explains the underlying representation.
Converting a date back to a timestamp
Use an ISO date with an explicit timezone, such as 2026-01-01T00:00:00Z or 2026-01-01T08:00:00+08:00. Those examples refer to the same instant. A bare date such as 2026-01-01 is rejected by this tool to avoid an ambiguous timezone assumption.
For sub-second input, the Unix-seconds result is rounded down, while the milliseconds result retains the supported millisecond resolution. Keep the original unit when moving results between systems; never label milliseconds as seconds just because the field is named “timestamp.”