Timestamp Converter
Convert Unix timestamps to readable dates and convert dates back to seconds or milliseconds. See UTC, local time, and ISO 8601 output at once.
Unix timestamp converter guide
A Unix timestamp is a numeric representation of time elapsed since January 1, 1970 at 00:00:00 UTC. It appears everywhere in backend logs, databases, JavaScript dates, analytics events, and API payloads, so quickly checking whether a value is in seconds or milliseconds saves a lot of debugging time.
Common use cases
- Turn raw log timestamps into readable dates during debugging
- Validate whether an API field is using seconds or milliseconds
- Generate current timestamp values for fixtures, seed data, and test payloads
- Debug timezone mismatches between frontend and backend systems
Recommended best practices
- Document timestamp fields explicitly as seconds or milliseconds in your API schema.
- When debugging external systems, compare timestamps with ISO 8601 strings for clarity.
- Store canonical values in UTC and only apply local timezone formatting at the presentation layer.
- In JavaScript, keep conversion helpers separate so Date.now() values are not mixed with Unix seconds.
Seconds vs milliseconds
10-digit values are usually seconds
Values like 1710403200 are typically Unix seconds. They are common in backend logs, SQL functions, and many server-side languages.
13-digit values are usually milliseconds
Values like 1710403200000 are typically Unix milliseconds. They are common in JavaScript Date.now(), browser events, and some document databases.
Wrong units create huge date shifts
Treat seconds as milliseconds and you jump back toward 1970. Treat milliseconds as seconds and you end up far in the future. Unit checks matter.
Frequent implementation mistakes
- Sending JavaScript Date.now() directly into an API that expects seconds
- Displaying a UTC timestamp as local time without making the conversion explicit
- Assuming both frontend and backend use the same unit without checking the contract
- Forgetting that datetime-local inputs are interpreted in the browser's local time zone