[{"data":1,"prerenderedAt":240},["ShallowReactive",2],{"page:/guides/what-is-unix-timestamp":3},{"id":4,"title":5,"body":6,"description":226,"extension":227,"eyebrow":228,"faq":229,"locale":230,"meta":231,"navigation":232,"pageType":233,"path":234,"related":229,"seo":235,"stem":238,"__hash__":239},"pages/en/guides/what-is-unix-timestamp.md","What is a Unix timestamp?",{"type":7,"value":8,"toc":214},"minimark",[9,14,23,38,42,45,49,52,56,70,74,87,159,163,174,181,185,198,202],[10,11,13],"h2",{"id":12},"the-short-definition","The short definition",[15,16,17,18,22],"p",{},"A Unix timestamp is a signed count of elapsed time from ",[19,20,21],"code",{},"1970-01-01T00:00:00Z",". In the classic definition, the unit is seconds. Modern APIs also use milliseconds, microseconds and nanoseconds, so a bare number is incomplete unless its unit is known.",[15,24,25,26,29,30,33,34,37],{},"Timestamp ",[19,27,28],{},"0"," is the Unix epoch. Timestamp ",[19,31,32],{},"-1"," second is ",[19,35,36],{},"1969-12-31T23:59:59Z",". Negative values are valid where the runtime and storage type support them.",[10,39,41],{"id":40},"utc-and-time-zones","UTC and time zones",[15,43,44],{},"The timestamp identifies an instant on the UTC timeline. It carries no city, country, daylight-saving rule or preferred display format. Formatting the same timestamp in Shanghai and New York produces different clock readings while preserving the same instant.",[10,46,48],{"id":47},"leap-seconds","Leap seconds",[15,50,51],{},"Unix time generally treats each day as 86,400 seconds and does not encode leap seconds as distinct numbered seconds. For most web and database work this convention is expected; scientific timing systems may use other time scales.",[10,53,55],{"id":54},"a-reproducible-example","A reproducible example",[15,57,58,61,62,65,66,69],{},[19,59,60],{},"1700000000"," seconds converts to ",[19,63,64],{},"2023-11-14T22:13:20.000Z",". Multiplying by 1,000 gives ",[19,67,68],{},"1700000000000"," milliseconds without changing the instant.",[10,71,73],{"id":72},"read-a-timestamp-from-an-api-or-log","Read a timestamp from an API or log",[15,75,76,77,80,81,86],{},"A field called ",[19,78,79],{},"created_at"," might contain an ISO string, Unix seconds or Unix milliseconds. The field name alone does not identify its format. Check the API specification, paste the value into the ",[82,83,85],"a",{"href":84},"/timestamp-to-date/","timestamp-to-date converter",", and choose the documented unit. Compare UTC with the expected event date before copying the result.",[88,89,90,106],"table",{},[91,92,93],"thead",{},[94,95,96,100,103],"tr",{},[97,98,99],"th",{},"Seconds",[97,101,102],{},"UTC date",[97,104,105],{},"Meaning",[107,108,109,122,134,146],"tbody",{},[94,110,111,116,119],{},[112,113,114],"td",{},[19,115,32],{},[112,117,118],{},"1969-12-31 23:59:59",[112,120,121],{},"One second before the epoch",[94,123,124,128,131],{},[112,125,126],{},[19,127,28],{},[112,129,130],{},"1970-01-01 00:00:00",[112,132,133],{},"Epoch origin",[94,135,136,140,143],{},[112,137,138],{},[19,139,60],{},[112,141,142],{},"2023-11-14 22:13:20",[112,144,145],{},"A normal modern timestamp",[94,147,148,153,156],{},[112,149,150],{},[19,151,152],{},"2147483647",[112,154,155],{},"2038-01-19 03:14:07",[112,157,158],{},"Largest signed 32-bit second value",[10,160,162],{"id":161},"one-instant-different-clock-readings","One instant, different clock readings",[15,164,165,166,168,169,173],{},"For ",[19,167,60],{},", UTC is November 14 at 22:13:20. Shanghai is November 15 at 06:13:20, and New York is November 14 at 17:13:20. The timestamp stays identical; only the calendar presentation changes. Use the ",[82,170,172],{"href":171},"/time-zone-converter/","time-zone display tool"," to verify a regional reading.",[15,175,176,177,180],{},"Unix time is not an atomic clock or an elapsed-duration stopwatch. Common POSIX-style timestamps do not count leap seconds as extra ordinary seconds. Your device clock may also be corrected while the page is open. For measuring a short operation in JavaScript, use a monotonic timer such as ",[19,178,179],{},"performance.now()",", rather than subtracting two device-clock dates.",[10,182,184],{"id":183},"keep-the-unit-with-the-value","Keep the unit with the value",[15,186,187,188,192,193,197],{},"Store or document the unit alongside a numeric timestamp. Use ",[82,189,191],{"href":190},"/guides/seconds-vs-milliseconds/","seconds versus milliseconds"," when a value looks implausible. To interpret a calendar time instead, use ",[82,194,196],{"href":195},"/date-to-timestamp/","date to timestamp"," and specify its source time zone.",[10,199,201],{"id":200},"standards-and-runtime-references","Standards and runtime references",[203,204,205],"ul",{},[206,207,208],"li",{},[82,209,213],{"href":210,"rel":211},"https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-time-values-and-time-range",[212],"nofollow","ECMAScript Date time values",{"title":215,"searchDepth":216,"depth":216,"links":217},"",2,[218,219,220,221,222,223,224,225],{"id":12,"depth":216,"text":13},{"id":40,"depth":216,"text":41},{"id":47,"depth":216,"text":48},{"id":54,"depth":216,"text":55},{"id":72,"depth":216,"text":73},{"id":161,"depth":216,"text":162},{"id":183,"depth":216,"text":184},{"id":200,"depth":216,"text":201},"A precise explanation of the Unix epoch, UTC, negative timestamps, units and what an epoch number actually identifies.","md","Guide / foundations",null,"en",{},true,"guide","/en/guides/what-is-unix-timestamp",{"title":236,"description":237},"What Is a Unix Timestamp? Unix Epoch Explained","Learn what Unix timestamps count, why the epoch starts in 1970, how negative values work, and why timestamps have no time zone.","en/guides/what-is-unix-timestamp","y1KCbi62Dv5aZIXVFxB0UZDCNEbBZGjDclYkS3OTsA8",1792032483053]