Checking seconds versus milliseconds before Unix timestamp conversion
The Unix timestamp converter reads a count of whole seconds. A millisecond count must be divided by 1,000 before it is entered, or the converter will name a different instant.
Two units that look alike
A Unix timestamp counts time since 1970-01-01T00:00:00Z, the Unix epoch. Some systems count in seconds and others in milliseconds, and the numbers are easy to confuse because both are plain integers. A seconds value in 2024 has 10 digits, about 1.7 billion. A milliseconds value for the same moment has 13 digits, about 1.7 trillion. JavaScript's Date.now() and Java's System.currentTimeMillis() return milliseconds, while the classic C time() function and many databases return seconds. The field on this page is labeled seconds, and the converter treats whatever you type as seconds, without trying to guess the unit from the size of the number.
The one-second control
The first case enters 1. One second after the epoch is 1970-01-01T00:00:01Z, and the converter returns exactly that. This is also what a source value of 1,000 milliseconds means, because 1,000 divided by 1,000 is 1 second. The control shows what the correct entry looks like when the source count is in milliseconds: convert first, then enter. A single second is a small enough interval to read without any calendar arithmetic, which makes it a good sanity check before you trust a conversion of larger values. Another reference is 60 seconds, which should return 1970-01-01T00:01:00Z, and 3,600 seconds, which should return 01:00:00Z. If those come out right, the field is behaving as a seconds field and any surprise lies in the number you brought.
What happens when 1,000 is entered unchanged
The second case enters 1000 into the seconds field. A thousand seconds is 16 minutes and 40 seconds, so the converter returns 1970-01-01T00:16:40Z. If the number came from a source that counts milliseconds, the writer meant one second after the epoch, and the converter has reported an instant 999 seconds too late. The page makes no error, since 1,000 is a valid count of seconds. The mistake sits in the interpretation, which is why unit labels belong next to every timestamp you store or share. A column called created_at with no unit gives the next reader the same trap. Naming it created_at_ms or created_at_s, or writing the unit in the schema documentation, removes the doubt before a conversion is ever attempted, and it costs a few characters.
Scaling a modern millisecond value
Real values show the same pattern at larger size. The millisecond count 1,704,067,200,000 is 2024-01-01T00:00:00Z. Divided by 1,000, it becomes 1,704,067,200 seconds, which the converter turns into that midnight. Entered unchanged as seconds, the same digits point about 54,000 years past 1970, far outside any date range that matters. A date in the far future or the distant past is therefore a strong sign that the unit is wrong by a factor of 1,000. The reverse mistake is equally revealing: seconds treated as milliseconds land in January 1970, within a few weeks of the epoch.
Fractions and rounding
The field accepts whole seconds. A millisecond count that is not a multiple of 1,000, such as 1,500, stands for 1.5 seconds, which does not fit. Truncating it to 1 second silently moves the instant by half a second, and rounding to 2 seconds moves it by half a second in the other direction. Neither choice is neutral, so decide on a rounding policy and write it down: floor for a log that reports when something had already happened, round to nearest for display. Where sub-second precision matters, keep the original millisecond integer alongside the converted seconds, so no information disappears.
Spotting the unit from the digit count
Digit counts give a quick estimate for present-day dates. Ten digits point to seconds. Thirteen digits point to milliseconds. Sixteen digits point to microseconds, as used by some databases and by Python's datetime internals, and nineteen digits point to nanoseconds, as used by Go's UnixNano and many tracing systems. The rule fails for dates near the epoch, where values have fewer digits, so it is a hint and not a proof. When a unit is documented, trust the documentation. When it is not, convert one value under each assumption and see which date looks plausible for the record.
Why the epoch is a convention
The Unix epoch was chosen by the designers of early Unix systems, and POSIX later defined Unix time as the number of seconds since 1970-01-01T00:00:00Z, not counting leap seconds. Each day is treated as exactly 86,400 seconds. The convention is simple and portable, and it is why the same integer means the same instant on every compliant system. Other epochs exist, including 1900 for NTP, 1601 for Windows FILETIME and 2001 for Apple's Core Foundation, and mixing epochs produces errors of decades. This converter uses the 1970 epoch only.
Larger examples in both units
A date well after the epoch shows how large the two scales are. One day is 86,400 seconds, so 10 days after the epoch is 864,000 seconds, 1970-01-11T00:00:00Z. In milliseconds the same instant is 864,000,000. A common milestone is the count 1,000,000,000 seconds, reached on 2001-09-09 at 01:46:40 UTC. The count 2,147,483,647 seconds, which is the largest signed 32-bit integer, falls on 2038-01-19 at 03:14:07 UTC, and systems that store seconds in 32 bits overflow shortly after. Millisecond counters need 64-bit storage to avoid the problem. These landmarks give you reference points for judging a converted result.
A checklist before converting a stored value
Before you convert a number from a log, a file or an API response, find out three things: the unit, the epoch and the time scale. If the field name says ms, millis or milliseconds, divide by 1,000. If it says seconds or is documented as a Unix timestamp, enter it as is. Then check that the converted date is reasonable for the record. A conversion that lands in 1970 or in the year 55,000 is wrong in unit, and a date a few seconds off from the one you expect often points to a rounding choice instead. After a correct conversion, the UTC result can be shown in a local zone with an explicit offset if a person needs to read it. Keep the UTC form in the record, since a local rendering depends on the rules of a zone that may change, and a UTC instant never does. If the same value must be reused in a spreadsheet, a program or another converter, state the unit in the cell header or variable name. Note the conversion you made, such as divided 1,704,067,200,000 by 1,000, so a colleague can follow the steps.
Reproduce the checks
One whole second
Open the Unix Timestamp Converter and enter:
- Seconds
1
Expected output:
Seconds
1Utc
1970-01-01T00:00:01ZThis is the instant represented by one thousand milliseconds.
One thousand whole seconds
Open the Unix Timestamp Converter and enter:
- Seconds
1000
Expected output:
Seconds
1000Utc
1970-01-01T00:16:40ZThe input is interpreted according to the seconds field label.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- Primary definition and convention reference ↗ · 2026-10-08