4 ms·
make everything UTC, people. It'll make your life way easier. Try it out.
by kristopolous 5y ago
make everything UTC, people. It'll make your life way easier. Try it out.
- Too 5y agoInternally yes, this is a no brainer. However in log files that are often read directly by humans, who want to see things in local time, it can become a balance and you might need to fight some admins for it. A proper structural logging system solves this, but log files on disk and other ad-hoc diy logs is still extremely common to see.
- guipsp 5y agoJust live in GMT+0. Easy!
- alephnil 5y agoI have sometimes put my computer in the Iceland time zone for that reason when using dual boot with Linux, since Linux prefer to run UTC on the clock, and the Iceland time zone is UTC+0 with no daylight saving time. Making windows believe it is in Iceland make sure it does not mess up the clock. Though it is possible to set windows to UTC too with the same effect.
- gpderetta 5y agoEspecially in log files I want to see UTC. When you have servers all around the world, I do not want to figure out what timezone was the specific server running in nor I want to convert between timezones when comparing logs of different servers.
- barrkel 5y agoOn-disk logs should use ISO-8601 in UTC, ideally first thing on the line. That way you can merge them from different sources and sort them to help figure out interactions and causality. There might be clock drift from different sources but that's a much smaller problem than trying to eyeball multiple different logs concurrently, or write ad-hoc scripts to enable merging.
- Too 5y agoFor pure servers, what you say is easy and yes, almost exclusively, the preferred option. The tricky situations usually occur in CI, where you script together a lot of weird tools, most of them originally designed to be run by hands on developers workstation, where they want to see local timestamps and never had time to implement log config. Some days you can consider yourself lucky if the log files have any timestamps at all.
- EsotericAlgo 5y agoOne especially frustrating version of this is a log or the like reporting a time as UTC but it’s not. So close.
- AYBABTME 5y agoStill need the timezone in the timestamp, UTC or not.
- BurningFrog 5y agoThis is good advice, but ONLY for timestamps. When people try to apply this to other time related info, it's always a disaster.
- makeitdouble 5y agoOnly if literally _everything_ is UTC. If you can’t go that far and still need local time zones in some specific part, just embrace your fate and keep and display timezones everywhere, even when it’s UTC. TBH, I’ve never seen an organization that could 100% move everything to UTC. Especially with countries following DST and other shenanigans, and you want to quickly be able to compare events at the same local time.
- kristopolous 5y agoUse timezones as an interface accommodation and not a storage format. If you're going to do it in storage, keep it outside the ISO/8601 string. Chronology is the most important thing to get right. Locality comes after
- sleepydog 5y agoAbsolutely. I support this 100%. But even if everything is in UTC, please, please make sure that it's clear that the time is UTC. That could mean an ISO 8601 timestamp with 'Z' or '+0' at the end, or a 'UTC' in the corner of your graph, or using unix timestamps. Unless the whole world agrees to communicate times in UTC, at some point, you will share a screenshot or a log message with someone outside of your company, and they cannot assume what time zone it's in.