[{"data":1,"prerenderedAt":227},["ShallowReactive",2],{"page:/guides/seconds-vs-milliseconds/":3},{"id":4,"title":5,"body":6,"description":213,"extension":214,"eyebrow":215,"faq":216,"locale":217,"meta":218,"navigation":219,"pageType":220,"path":221,"related":216,"seo":222,"stem":225,"__hash__":226},"pages/en/guides/seconds-vs-milliseconds.md","Unix seconds vs milliseconds",{"type":7,"value":8,"toc":202},"minimark",[9,14,31,35,38,42,53,57,132,144,148,151,166,170,183,186,190],[10,11,13],"h2",{"id":12},"the-thousand-fold-difference","The thousand-fold difference",[15,16,17,18,22,23,26,27,30],"p",{},"Seconds count whole seconds after the epoch. Milliseconds count thousandths of a second, so the same instant has a value 1,000 times larger. For example, ",[19,20,21],"code",{},"1700000000 s"," and ",[19,24,25],{},"1700000000000 ms"," are both ",[19,28,29],{},"2023-11-14T22:13:20Z",".",[10,32,34],{"id":33},"why-digit-count-is-only-a-hint","Why digit count is only a hint",[15,36,37],{},"Current positive values are commonly 10 digits in seconds and 13 in milliseconds. Near the epoch they are shorter. Negative values include a sign. Far-future values grow longer. Reliable software should accept an explicit unit or show what it detected.",[10,39,41],{"id":40},"precision-and-safe-integers","Precision and safe integers",[15,43,44,45,48,49,52],{},"JavaScript numbers exactly represent integers only through ",[19,46,47],{},"Number.MAX_SAFE_INTEGER",". This site uses ",[19,50,51],{},"BigInt"," while changing epoch units so 16- and 19-digit inputs are not rounded before their millisecond date representation is calculated.",[10,54,56],{"id":55},"compare-four-representations-of-the-same-instant","Compare four representations of the same instant",[58,59,60,76],"table",{},[61,62,63],"thead",{},[64,65,66,70,73],"tr",{},[67,68,69],"th",{},"Unit",[67,71,72],{},"Value",[67,74,75],{},"Scale relative to seconds",[77,78,79,93,106,119],"tbody",{},[64,80,81,85,90],{},[82,83,84],"td",{},"Seconds",[82,86,87],{},[19,88,89],{},"1700000000",[82,91,92],{},"1",[64,94,95,98,103],{},[82,96,97],{},"Milliseconds",[82,99,100],{},[19,101,102],{},"1700000000000",[82,104,105],{},"1,000",[64,107,108,111,116],{},[82,109,110],{},"Microseconds",[82,112,113],{},[19,114,115],{},"1700000000000000",[82,117,118],{},"1,000,000",[64,120,121,124,129],{},[82,122,123],{},"Nanoseconds",[82,125,126],{},[19,127,128],{},"1700000000000000000",[82,130,131],{},"1,000,000,000",[15,133,134,135,137,138,143],{},"All four produce ",[19,136,29],{},". Multiplying by 1,000 changes the unit, not the instant. It does not create additional measured precision. Try these values in the ",[139,140,142],"a",{"href":141},"/timestamp-to-date/","converter"," with the unit selected explicitly.",[10,145,147],{"id":146},"diagnose-a-date-near-1970-or-far-in-the-future","Diagnose a date near 1970 or far in the future",[15,149,150],{},"If a modern event unexpectedly appears in January 1970, a seconds value may have been interpreted as milliseconds. If it appears tens of thousands of years away, a milliseconds value may have been interpreted as seconds. Before changing the number, check the original system's field documentation. Ten and thirteen digits are clues for contemporary dates, not universal validation rules.",[15,152,153,154,157,158,160,161,165],{},"For historical data, ",[19,155,156],{},"1000"," seconds is 1970-01-01 00:16:40 UTC; ",[19,159,156],{}," milliseconds is 00:00:01 UTC. Both are valid. Choose the unit in the ",[139,162,164],{"href":163},"/batch-converter/","batch converter"," when every row follows the same source specification.",[10,167,169],{"id":168},"rounding-is-a-data-decision","Rounding is a data decision",[15,171,172,175,176,179,180,182],{},[19,173,174],{},"1700000000123"," milliseconds contains 123 milliseconds beyond the whole second. Converting it to whole seconds discards that fraction. This site rounds down to the beginning of the containing unit: ",[19,177,178],{},"-1"," nanosecond belongs to millisecond ",[19,181,178],{},", not millisecond zero.",[15,184,185],{},"Fine-unit output preserves the integer input exactly. ISO calendar output is limited to milliseconds and displays a precision notice when a finer remainder exists. Keep the original integer when auditing a database with microsecond or nanosecond timestamps; a readable date alone is insufficient for an exact round trip.",[10,187,189],{"id":188},"standards-and-runtime-references","Standards and runtime references",[191,192,193],"ul",{},[194,195,196],"li",{},[139,197,201],{"href":198,"rel":199},"https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-time-values-and-time-range",[200],"nofollow","ECMAScript Date time values",{"title":203,"searchDepth":204,"depth":204,"links":205},"",2,[206,207,208,209,210,211,212],{"id":12,"depth":204,"text":13},{"id":33,"depth":204,"text":34},{"id":40,"depth":204,"text":41},{"id":55,"depth":204,"text":56},{"id":146,"depth":204,"text":147},{"id":168,"depth":204,"text":169},{"id":188,"depth":204,"text":189},"Compare 10-digit and 13-digit timestamps, unit detection, precision, storage limits and conversion errors.","md","Guide / precision",null,"en",{},true,"guide","/en/guides/seconds-vs-milliseconds",{"title":223,"description":224},"Unix Timestamp Seconds vs Milliseconds — 10 or 13 Digits","Understand the difference between Unix seconds and milliseconds, identify common 10- and 13-digit values, and convert safely.","en/guides/seconds-vs-milliseconds","gthqvLtieBAwlcp8FNkO3orTDXwxeJCTWhQFFYgJYH8",1792032486603]