Milliseconds to Seconds Converter
Convert milliseconds to seconds instantly. Paste a 13-digit JavaScript timestamp or any millisecond value to get seconds, a human-readable date, and the equivalent Unix timestamp.
Convert Milliseconds to Seconds
Enter any value in milliseconds โ a Date.now() output, a 13-digit API timestamp, or a duration โ to convert it to seconds and a readable date/time.
- ms โ seconds: Divide by 1000 โ instantly shown with decimal precision
- ms โ readable date: Decode a 13-digit epoch timestamp to UTC and local time
- Duration conversion: Convert millisecond durations to minutes, hours, and days
- Reverse: Convert seconds timestamps to milliseconds for JavaScript use
Milliseconds Conversion Reference
- 1 second = 1,000 milliseconds
- 1 minute = 60,000 milliseconds
- 1 hour = 3,600,000 milliseconds
- 1 day = 86,400,000 milliseconds
- 1 week = 604,800,000 milliseconds
- 30 days = 2,592,000,000 milliseconds
- 1 year (365 days) = 31,536,000,000 milliseconds
When You Encounter Millisecond Values
- JavaScript
Date.now(): Always returns milliseconds โ a 13-digit number. Divide by 1000 before storing as a Unix timestamp or passing to server-side systems that expect seconds - API responses: Many modern REST APIs return
created_atortimestampfields in milliseconds โ check whether the value is 10 or 13 digits to identify the unit - Performance timing:
performance.now()in browsers returns milliseconds with sub-millisecond decimal precision โ useful for measuring function execution time - Log timestamps: Java's
System.currentTimeMillis()and many logging frameworks output millisecond timestamps โ convert to seconds for Unix tools likedate -d @timestamp
Frequently Asked Questions
How do I convert milliseconds to a readable date in different languages?
JavaScript: new Date(ms).toISOString() โ pass ms directly. Python: datetime.fromtimestamp(ms / 1000) โ divide by 1000 first since Python expects seconds. Go: time.UnixMilli(ms) (Go 1.17+) or time.Unix(ms/1000, (ms%1000)*int64(time.Millisecond)). Java: Instant.ofEpochMilli(ms). SQL (PostgreSQL): to_timestamp(ms / 1000.0).
How can I tell if a timestamp is in seconds or milliseconds?
Count the digits: a 10-digit number (e.g., 1700000000) is a Unix second timestamp representing a date in the 2000s. A 13-digit number (e.g., 1700000000000) is a millisecond timestamp. As a rule: if the value divided by 1000 gives a plausible recent year when decoded as a Unix timestamp, the original was in milliseconds. Values in the billions that decode to dates in 1970โ2001 are likely second timestamps that were misread as milliseconds.
Why do some systems use milliseconds and others use seconds?
The difference comes from historical convention and precision requirements. Unix (1970s) standardized on seconds โ sufficient for file timestamps and scheduling. JavaScript (1995) chose milliseconds to support sub-second UI animations. Java followed JavaScript's convention. Modern systems often use milliseconds or even microseconds/nanoseconds for distributed systems (where ordering events within a second matters). The lack of a single universal standard is why timestamp unit confusion is so common.