Skip to content

TZ Environment variable is not considered #914

Description

@JVApen

In

date/src/tz.cpp

Line 4201 in 7875f43

tzdb::current_zone() const
, the linux code immediately reads the /etc/timezone file, while many programs support the TZ environment variable.

For example, if you execute the following:

TZ="Etc/UTC" date
TZ="Europe/Brussels" date

it results in:

Tue Jul 14 08:01:49 AM UTC 2026
Tue Jul 14 10:01:49 AM CEST 2026

One would expect similar behavior when using tzdb::current_zone()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions