[{"data":1,"prerenderedAt":226},["ShallowReactive",2],{"page:/guides/iso-8601-and-unix-time":3},{"id":4,"title":5,"body":6,"description":212,"extension":213,"eyebrow":214,"faq":215,"locale":216,"meta":217,"navigation":218,"pageType":219,"path":220,"related":215,"seo":221,"stem":224,"__hash__":225},"pages/en/guides/iso-8601-and-unix-time.md","ISO 8601 and Unix time",{"type":7,"value":8,"toc":201},"minimark",[9,14,31,35,47,51,54,58,61,118,130,134,151,162,166,173,185,189],[10,11,13],"h2",{"id":12},"number-versus-formatted-date","Number versus formatted date",[15,16,17,18,22,23,26,27,30],"p",{},"A Unix timestamp is compact and convenient for arithmetic. ISO 8601 is readable and can state an offset. ",[19,20,21],"code",{},"2023-11-14T22:13:20Z"," uses ",[19,24,25],{},"Z"," to declare UTC and maps to Unix timestamp ",[19,28,29],{},"1700000000"," seconds.",[10,32,34],{"id":33},"preserve-the-instant","Preserve the instant",[15,36,37,39,40,43,44,46],{},[19,38,21],{}," and ",[19,41,42],{},"2023-11-15T06:13:20+08:00"," describe the same instant. Converting both to Unix time produces the same value. An ISO string without ",[19,45,25],{}," or an offset needs an external rule defining its time zone.",[10,48,50],{"id":49},"round-trip-choices","Round-trip choices",[15,52,53],{},"Use an ISO string with an explicit offset for interchange and logs meant for humans. Use a Unix value when the unit is clearly documented and compact arithmetic matters. Keep fractional seconds if the source contains meaningful precision.",[10,55,57],{"id":56},"compare-an-offset-date-with-unix-time","Compare an offset date with Unix time",[15,59,60],{},"These date strings identify the same instant:",[62,63,64,77],"table",{},[65,66,67],"thead",{},[68,69,70,74],"tr",{},[71,72,73],"th",{},"Representation",[71,75,76],{},"Value",[78,79,80,90,99,109],"tbody",{},[68,81,82,86],{},[83,84,85],"td",{},"UTC",[83,87,88],{},[19,89,21],{},[68,91,92,95],{},[83,93,94],{},"Beijing offset",[83,96,97],{},[19,98,42],{},[68,100,101,104],{},[83,102,103],{},"New York offset",[83,105,106],{},[19,107,108],{},"2023-11-14T17:13:20-05:00",[68,110,111,114],{},[83,112,113],{},"Unix seconds",[83,115,116],{},[19,117,29],{},[15,119,120,121,123,124,126,127,129],{},"The letter ",[19,122,25],{}," means a UTC offset of zero. A signed offset states how far the displayed clock is ahead of or behind UTC. Removing ",[19,125,25],{}," or the offset leaves a wall-clock reading that needs an interpretation zone. Adding ",[19,128,25],{}," to a Beijing clock reading does not convert it to UTC; it declares a different instant.",[10,131,133],{"id":132},"perform-a-reliable-round-trip","Perform a reliable round trip",[15,135,136,137,142,143,145,146,150],{},"Start with the ",[138,139,141],"a",{"href":140},"/timestamp-to-date/","timestamp converter",", select seconds and enter ",[19,144,29],{},". Copy its ISO result. To verify the reverse direction, enter November 14, 2023 at 22:13:20 in ",[138,147,149],{"href":148},"/date-to-timestamp/","date to timestamp",", select UTC, and request seconds. The result should be the original number.",[15,152,153,154,157,158,161],{},"When communicating dates between systems, specify whether fractional seconds are supported. ",[19,155,156],{},"2023-11-14T22:13:20.123Z"," maps to ",[19,159,160],{},"1700000000123"," milliseconds. A seconds-only destination cannot retain the 123-millisecond fraction.",[10,163,165],{"id":164},"choose-the-format-for-the-destination","Choose the format for the destination",[15,167,168,169,172],{},"ISO 8601 covers more forms than many parsers accept. RFC 3339 is a narrower internet timestamp profile; an extended calendar date, time and explicit offset is a practical interchange choice. A zone suffix such as ",[19,170,171],{},"[America/New_York]"," carries an IANA identifier but is not accepted by every ISO or RFC 3339 parser. Use the UTC ISO output when a receiver expects a plain machine timestamp, and retain the zone separately when regional scheduling rules matter.",[15,174,175,176,179,180,184],{},"Avoid locale strings such as ",[19,177,178],{},"03/04/2026"," in APIs: the date order is ambiguous. See ",[138,181,183],{"href":182},"/guides/time-zones-and-dst/","time zones and DST"," before interpreting dates without offsets.",[10,186,188],{"id":187},"standards-and-runtime-references","Standards and runtime references",[190,191,192],"ul",{},[193,194,195],"li",{},[138,196,200],{"href":197,"rel":198},"https://www.rfc-editor.org/rfc/rfc3339",[199],"nofollow","RFC 3339",{"title":202,"searchDepth":203,"depth":203,"links":204},"",2,[205,206,207,208,209,210,211],{"id":12,"depth":203,"text":13},{"id":33,"depth":203,"text":34},{"id":49,"depth":203,"text":50},{"id":56,"depth":203,"text":57},{"id":132,"depth":203,"text":133},{"id":164,"depth":203,"text":165},{"id":187,"depth":203,"text":188},"Compare numeric epoch values with readable ISO 8601 dates, offsets, Z notation and round-trip conversion.","md","Guide / formats",null,"en",{},true,"guide","/en/guides/iso-8601-and-unix-time",{"title":222,"description":223},"ISO 8601 vs Unix Timestamp — Dates, Z and UTC Offsets","Compare ISO 8601 date strings with Unix timestamps and understand Z, UTC offsets and safe round trips.","en/guides/iso-8601-and-unix-time","FuGM4QqcbLBzr1Bj6R5g1KKXNgrekV8hib9k43uu-YQ",1792032483055]