5 ms·
Why it should be? The behavior is correct, /etc/localtime could change since last read so it is necessary to check whether old value can be used. The real probl
by zajio1am 4y ago
Why it should be? The behavior is correct, /etc/localtime could change since last read so it is necessary to check whether old value can be used. The real problem is calling localtime() so often.
- boring_twenties 4y agoIf that behavior is correct, then the behavior with TZ=:/etc/localtime must be incorrect?
- zajio1am 4y agoIt is not incorrect in general, but it is kind of hack that may be incorrect in some situations (as it does not reflect change in system timezone), so it is not suitable for default behavior. Default behavior - use current system timezone Explicit TZ - use specific timezone defined by TZ variable, defined either directly (e.g. TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0,M3.3.0"), or indirectly from file (e.g. TZ=":/usr/share/zoneinfo/Europe/Brussels"). As this defines specific timezone, it is not supposed to change.
- boring_twenties 4y agoSo basically, always set TZ=:/etc/localtime.
- eqvinox 4y ago[moved my comment to top-level - https://news.ycombinator.com/item?id=34353072 https://news.ycombinator.com/item?id=34353072] TL;DR: no, not correct, put a rate limit on it.