Repository navigation
date: drop the seconds of an offset in %z and %:z like GNU - #17142
Open
zodrickjohn wants to merge 1 commit into
Open
zodrickjohn wants to merge 1 commit into
zodrickjohn wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two differences from GNU in the numeric time zone conversions, both for the historical offsets of tzdata (before about 1970) and POSIX
TZvalues:1.
%zand%:zprinted the seconds of an offset. jiff writes them when they are not zero; GNU has no seconds field in these two and drops them (it truncates: -00:44:30 is-0044, not-0045).%::zand%:::zkeep them, as before.The two are now cut from
%::z. A format without modifiers only takes the slower modifier path when the offset has seconds and the format contains az.2.
-stripped an offset under an hour to three digits. GNU strips the digits of%zas one number:strip_timezone_hour_paddingnow strips everything before the first colon, which also covers the all-zero case it handled separately.I compared GNU coreutils 9.12 with this branch on every flag (none,
0,_,-,+,^,#and pairs) and widths 1 to 10 of the four conversions, in 10 zones (Africa/Monrovia 1938, America/New_York 1874, Europe/Dublin 1912,AMT-0:20,XST0:30, Asia/Kolkata, UTC, Pacific/Chatham, America/St_Johns, Pacific/Kiritimati). Together with #17141, which fixes the padding with a width or the+/^/#flags, all 3960 combinations match; the branches merge without conflicts. The new test uses POSIXTZvalues, so it does not depend on tzdata, and it fails on main.