【发布时间】:2015-02-14 05:59:45
【问题描述】:
我有一个嵌入式系统,我们希望在其中创建自定义夏令时。
我可以通过设置TZ环境变量来实现,例如:export TZ=IST-2IDT,M3.4.4/26,M10.5.0。
我们有几个守护进程正在运行(例如 daemonA、daemonB 等),如果其中一个导出 TZ,那么其他守护进程将无法看到它。所以这是个问题。一种可能的解决方法可能是使用文件而不是环境变量,以便“每个人”都可以看到它。
GNU C 库手册如下:
:characters
Each operating system interprets this format differently; in the GNU C Library, characters is the name of a file which describes the time zone.
当我export TZ=:/etc/TZ,然后echo IST-2IDT,M3.4.4/26,M10.5.0 > /etc/TZ 时,它不起作用。当我发出date 命令时,我看到了这一点:
Mon Aug 15 04:19:36 /etc/TZ 2016
谁能给我点线索?
非常感谢!!
【问题讨论】: