3 ms·
> The time on all contemporary computers is always Unix Epoch Time, which is close to (but not exactly) UTC. Setting your timezone doesn't actually change anyth
by jorams 6y ago
> The time on all contemporary computers is always Unix Epoch Time, which is close to (but not exactly) UTC. Setting your timezone doesn't actually change anything about how time works on the computer. It just changes how time is printed. That's it.
Sure, but the only thing users normally see is that printed representation. What's the actual problem you see here?
> I mean ... timezone support on Unix is basically buggy. It doesn't matter what TZ I set in my .profile, nevertheless the timezone of logs is in whatever TZ the server is running in.
I don't see what's buggy there. If you set a TZ in your .profile, logs produced by processes within the context of that .profile will be in your desired timezone. Processes outside that context look at the system timezone, configured using /etc/localtime.
The UTC system time crowd basically just wants all logs (that don't explicitly specify further) to be in a standard timezone that does not move, so that it can be reasoned about without a lot of context. Your perfect world with an epoch time in the first column does exactly that, with the downside of not meaning anything to a human without the timestamp-conversion command.
I agree we need better tools to deal with timestamps after the fact.
- doctor_eval 6y agoThe "bug" -- it's a strawman bug, actually im gonna go with strawbug :) -- is that TZ is supposed to specify what timezone I want to see times written in, and yet when I look at logs the time is not in the timezone I've chosen. So my ideal would be to be able to set TZ and see logs in TZ time. My ideal, to use epoch time instead of local time in logs, is because in a large number of cases I'm more interested in the relative time of log entries than the absolute time. Computing relative time (seconds intervals) between log entries is error prone. I suppose in a sense I'm in both the UTC and non-UTC camp. On reflection, I agree that server logs should be in UTC. I just don't think I should have to read them in UTC or personally operate in UTC. The ts tool mentioned above sounds perfect, and I'm gonna start playing with it...