PageSourceSearch

https://securoxen.io/assets/timezones-will-ruin-your-logs-B-x-qbsj.js

js securoxen.io collected 2026-10-02 01:59:30 UTC 3,377 bytes, 1 lines download raw bytes

1import{j as e}from"./index-0qbe4j-K.js";import{P as i}from"./prose-CP3GO64z.js";import{L as t}from"./react-vendor-CuqwDvgQ.js";function r(){return e.jsxs(i,{children:[e.jsx("p",{children:"Every incident becomes a timeline, and every timeline is built from timestamps produced by machines in different places with different opinions about what time it is. Most of the confusion in the first hour is not about what happened - it is about when."}),e.jsx("h3",{children:"Log in UTC, always"}),e.jsx("p",{children:"A server logging in local time produces a file that cannot be merged with any other file without knowing which local. Worse, twice a year it produces an hour that happens twice and an hour that never happens at all."}),e.jsxs("p",{children:["UTC has no daylight saving and no ambiguity. Log in UTC, store in UTC, and convert to local only at the moment a human looks at it. The"," ",e.jsx(t,{to:"/tools/timestamp-converter",children:"Unix Timestamp Converter"})," shows both at once, which is what you want while reading."]}),e.jsx("h3",{children:"The repeated hour is real"}),e.jsxs("p",{children:["When clocks go back, ",e.jsx("code",{children:"01:30"})," local occurs twice. A timestamp written in local time in that window is genuinely ambiguous - there is no rule that recovers which one it was. Sort by it and you get an ordering that is simply wrong."]}),e.jsxs("p",{children:["In the spring, the opposite: an hour that does not exist. A scheduled job at"," ",e.jsx("code",{children:"02:30"})," local either does not run or runs twice, depending on the scheduler. Anything that must happen exactly once should be scheduled in UTC."]}),e.jsx("h3",{children:"The window is not the same day everywhere"}),e.jsx("p",{children:"A maintenance window at 22:30 UTC on a Sunday is 07:30 Monday in Tokyo. Announce it in local time to one team and you have told half the company the wrong day - not the wrong hour, the wrong day."}),e.jsxs("p",{children:["Announce in UTC with local conversions spelled out for each team. Work them out with the"," ",e.jsx(t,{to:"/tools/timezone-planner",children:"Timezone Planner"}),", which shows the day rolling over rather than leaving you to notice."]}),e.jsx("h3",{children:"Seconds or milliseconds"}),e.jsxs("p",{children:[e.jsx("code",{children:"1751328000"})," and ",e.jsx("code",{children:"1751328000000"})," are the same instant in different units. Feed one to something expecting the other and you land in 1970 or somewhere past the year 50,000. If a converted date looks absurd, you have the wrong unit rather than corrupt data."]}),e.jsx("h3",{children:"Clock drift breaks more than timelines"}),e.jsxs("p",{children:["A machine whose clock is a minute out produces logs that interleave incorrectly with everything else. It also fails TOTP: codes are derived from the current time window, so a drifting clock rejects codes that the user's app generated correctly. Check the arithmetic with the ",e.jsx(t,{to:"/tools/totp-debugger",children:"TOTP Debugger"})," before blaming the user."]}),e.jsxs("p",{children:["Certificates have the same sensitivity in the other direction - a machine with a badly wrong clock will reject valid certificates or accept expired ones, which is covered in"," ",e.jsx(t,{to:"/learn/what-a-certificate-actually-says",children:"what a certificate actually says"}),"."]})]})}export{r as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.