Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
koebehshian
V2EX  ›  Linux

有关 Linux 时区

  •  
  •   koebehshian · Jul 18, 2022 · 2349 views
    This topic created in 1433 days ago, the information mentioned may be changed or developed.

    我查了GNU C 库手册,是通用 TZ 环境变量来设置的。在一台没有 systemd 的 arm 上测试 OK 。

    但是普通的 X86 UBUNTU 用的是 /etc/localtime 配置文件 参考freedesktop 用 TZ 变量可以覆盖。

    但明明 C 库只使用 TZ 环境变量,/etc/localtime 是如何生效的,是有个服务吗。

    julyclyde
        1
    julyclyde  
       Jul 18, 2022
    你看的这一篇文档标题叫 Specifying the Time Zone with TZ

    应该思考一下,without 该怎么办呢
    julyclyde
        2
    julyclyde  
       Jul 18, 2022   ❤️ 1
    仔细读,仔细读
    如果没明白就把文档再读一遍
    lcdtyph
        3
    lcdtyph  
       Jul 18, 2022 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 空的时候就去读你说的路径了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2498 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 07:01 · PVG 15:01 · LAX 00:01 · JFK 03:01
    ♥ Do have faith in what you're doing.