Many systems store timestamps in milliseconds rather than seconds, which gives finer precision for events that happen within the same second. The conversion is one multiplication beyond epoch seconds, but the digit length is where mistakes happen.
How it works
Epoch milliseconds = epoch seconds x 1000. Epoch seconds count from 1 January 1970, 00:00:00 UTC, so milliseconds count the same span in thousandths of a second. A current epoch-seconds value has 10 digits, while the same instant in milliseconds has 13 digits. Microseconds have 16 digits. If you see 13 digits, it is milliseconds; 10 digits means seconds; 16 means microseconds.
Step by step
- Convert your date and time to UTC.
- Find epoch seconds for that instant, using the day-count method or a converter.
- Multiply epoch seconds by 1000 for milliseconds.
- If you have fractional seconds, add them: milliseconds = seconds x 1000 + fractional part x 1000.
- Check the digit count: it should be 13 for current dates.
- When reading a timestamp, count digits first to know which unit you hold.
Worked example
1 January 2026, 00:00:00 UTC is 1,767,225,600 epoch seconds. In milliseconds that is 1,767,225,600,000. A time of 12:30:15.250 UTC on the same day adds 12 x 3600 + 30 x 60 + 15 = 45,015 seconds, plus 250 milliseconds. Total = (1,767,225,600 + 45,015) x 1000 + 250 = 1,767,270,615,250 milliseconds.
Common mistakes
- Feeding milliseconds into a function that expects seconds, which lands the date thousands of years in the future.
- Feeding seconds into a function that expects milliseconds, which lands in January 1970.
- Forgetting the UTC shift, which offsets the result by hours.
- Rounding fractional seconds away instead of adding them as milliseconds.
Try it with the free tool
You can follow every step above by hand, but the free tool below does the same calculation instantly. Try your own numbers in it, then check one result by hand so you trust the method as well as the answer. Open the full tool here: open the tool.
Checklist before you finish
- Write down every input number first, with its unit, before you calculate anything.
- Work through the steps in order, and do not skip the unit conversions.
- Check the answer against the worked example above: is it the right size, and does the direction make sense?
- Round only at the end, and keep the unrounded figure for any follow-up calculation.
Practice with your own numbers
Pick three cases of your own and work each one by hand. First, try a simple round-number case you can check mentally. Second, try a realistic case with awkward numbers, the kind you will actually meet. Third, try an edge case, such as a very small or very large input, and confirm the answer still behaves sensibly. If any case gives a surprising result, re-check the units and the formula step by step before you trust it.
If your answer looks wrong
Most errors come from a small set of causes. Check that you used the same units throughout, that you divided where the formula divides and multiplied where it multiplies, and that you applied any percentage as a decimal. Check the order of operations: powers and brackets come before multiplication and division, which come before addition and subtraction. Finally, test the method on the worked example in this guide. If your method reproduces the example answer, the method is right and the inputs deserve a second look.
Quick tips
When a timestamp looks wrong by a huge factor, check the digit count before anything else. Ten versus thirteen digits explains most timestamp bugs at a glance.
One more check
When you paste a timestamp into a new system, always test it with a known date first. Convert 1 January 2026 and confirm you get the expected result before you trust the pipeline with real event data. A two-minute test now saves hours of debugging later.
