Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date: display %Z alphabetic time zone abbreviation #7134

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

jfinkels
Copy link
Collaborator

Improve the display of dates formatted with the %Z specifier so that
the timezone abbreviation is displayed, not just its numeric offset.

To accomplish this, two dependencies on third-party packages chrono-tz and
iana-time-zone are added to our date package. Together, these two packages
allow us to produce time zone abbreviations (like UTC) from numeric
timezone offsets.

Finally, in order for the tests to be independent of which time zone you are in, I added support for the TZ=UTC0 environment variable, which forces the timezone to be UTC.

Fixes #3756

Most of the work was done by #5164, I'm just updating it and making the tests pass.

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/misc/stdbuf is no longer failing!

jfinkels and others added 2 commits January 14, 2025 17:49
Add dependencies on third-party packages `chrono-tz` and
`iana-time-zone` to our `date` package. Together, these two packages
allow us to produce time zone abbreviations (like `UTC`) from numeric
timezone offsets.
Improve the display of dates formatted with the `%Z` specifier so that
the timezone abbreviation is displayed, not just its numeric offset.

Fixes uutils#3756

Co-authored-by: Jeffrey Finkelstein <[email protected]>
@jfinkels jfinkels marked this pull request as ready for review January 14, 2025 23:38
@@ -280,6 +280,8 @@ chrono = { version = "0.4.38", default-features = false, features = [
] }
clap = { version = "4.5", features = ["wrap_help", "cargo"] }
clap_complete = "4.4"
chrono-tz = "0.8.3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some special reason for using this version instead of the current 0.10.0?

@cakebaker cakebaker merged commit c322fb5 into uutils:main Jan 15, 2025
65 checks passed
@cakebaker
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

date behaves differently with no args
3 participants