Use UTC for everything, except when displaying then convert at the last moment in UI code
The U in UTC is for Universal.
Use UTC for everything, except when displaying then convert at the last moment in UI code
The U in UTC is for Universal.
The weird thing is you need to always apply the timezone when reading, and un-apply it when writing. This needs to happen at the lowest level of access.
Speaking from my 30 years of experience reading logs. :)
Speaking from my 26 years of experience never reading logs.
this has a trivial solution - you convert the times of external events to UTC as well.
for example, the Super Bowl is going to cause a spike in traffic. the Super Bowl this year had its kickoff at 23:30 UTC.
> It's much easier when your logs match your clock.
part of the point of UTC is that "your clock" shouldn't be viewed as privileged or universal. because other people have different clocks.
what you're doing with this Arizona trick is basically inventing "UTC, but slightly different and more convenient for me specifically"
you get used to doing this "they usually match, except 4 months of the year they're off-by-one" trick. but then you're on a business trip to New York, and now you have to remember that it's either a 2 or 3 hour difference, depending on the time of year.
or, you hire a remote engineer in Adelaide, which is UTC+9:30 or UTC+10:30 depending on DST. do you want that engineer to be doing half-hour addition & subtraction in their head in order to correlate log timestamps in Arizona time with their local clock? also keep in mind they're in the southern hemisphere, so they have "summer time" reversed from the northern hemisphere, and they do 6 months on and 6 months off instead of 8 and 4 as the US does [0].
every desktop environment I know of supports adding a second clock with a different timezone to the system tray. on my work machines I have one for my local time, and one for UTC. it's very easy to look at the latter when I want to know "what's the current time as far as my servers are concerned".
[0] https://www.timeanddate.com/time/zone/australia/adelaide