Skip to content

date: alphabetic time zone abbreviation (%Z) prints local timezone, not the one specified in TZ #7497

@drinkcat

Description

@drinkcat

My local timezone in /etc/localtime is CET (Central Europe).

$ LANG= cargo run date
Wed Mar 19 20:05:44 CET 2025

Correct.

$ LANG= TZ=Asia/Taipei cargo run date
Thu Mar 20 03:06:12 CET 2025

Time is correct, but timezone is local CET, not CST.

A reduced test case can be shown with:

$ LANG= TZ=Asia/Taipei cargo run date +%Z
CET
$ LANG= TZ=US/Pacific cargo run date +%Z
CET

(note that TZ= correctly prints UTC, but prints the wrong date: #7498)

coreutils reference:

$ LANG= date
Wed Mar 19 20:09:23 CET 2025
$ LANG= TZ=Asia/Taipei date
Thu Mar 20 03:09:32 CST 2025
$ LANG= TZ=Asia/Taipei date +%Z
CST
$ LANG= TZ=US/Pacific cargo run date +%Z
PDT

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions