我查了GNU C 库手册,是通用 TZ 环境变量来设置的。在一台没有 systemd 的 arm 上测试 OK 。
但是普通的 X86 UBUNTU 用的是 /etc/localtime 配置文件 参考freedesktop 用 TZ 变量可以覆盖。
但明明 C 库只使用 TZ 环境变量,/etc/localtime 是如何生效的,是有个服务吗。
1
julyclyde 2022-07-18 12:37:01 +08:00
你看的这一篇文档标题叫 Specifying the Time Zone with TZ
应该思考一下,without 该怎么办呢 |
2
julyclyde 2022-07-18 12:43:50 +08:00 1
仔细读,仔细读
如果没明白就把文档再读一遍 |
3
lcdtyph 2022-07-18 12:44:58 +08:00 via iPhone 1
If the TZ environment variable does not have a value, the operation chooses a time zone by default. In the GNU C Library, the default time zone is like the specification ‘TZ=:/etc/localtime’ (or ‘TZ=:/usr/local/etc/localtime’, depending on how the GNU C Library was configured; see Installing the GNU C Library). Other C libraries use their own rule for choosing the default time zone, so there is little we can say about them.
TZ 空的时候就去读你说的路径了 |