Summary
%P is GNU's lowercase am/pm alternative to %p. The # flag requests case-swap. GNU treats %#P as a no-op (the value is already in the target case), emitting pm. uutils blindly flips case and emits PM.
Found by a fuzz_date run.
Reproduction
$ LC_ALL=C TZ=UTC /usr/bin/date -d '2024-06-15 13:45:30' '+%#P'
pm
$ LC_ALL=C TZ=UTC target/debug/coreutils date -d '2024-06-15 13:45:30' '+%#P'
PM
Test
#[test]
fn test_date_strftime_case_flag_on_alt_ampm() {
new_ucmd!()
.env("LC_ALL", "C")
.env("TZ", "UTC")
.arg("-d")
.arg("2024-06-15 13:45:30")
.arg("+%#P")
.succeeds()
.stdout_is("pm\n");
}
Summary
%Pis GNU's lowercaseam/pmalternative to%p. The#flag requests case-swap. GNU treats%#Pas a no-op (the value is already in the target case), emittingpm.uutilsblindly flips case and emitsPM.Found by a
fuzz_daterun.Reproduction
Test