#1034858 coreutils: pr: date format is %F %R always, must be %b %e %H:%M %Y if LC_TIME=C

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2023-04-25 21:21:04 UTC
Severity:
normal
#1034858#5
Date:
2023-04-25 21:19:15 UTC
From:
To:
Dear Maintainer,

Quoth Issue 8 Draft 2.1 (unchanged for a long time),
XCU, pr, STDOUT:
-- >8 --
104141  In the POSIX locale, the <output of date> field, representing the date and time of last modification
104142  of the input file (or the current date and time if the input file is standard input), shall be
104143  equivalent to the output of the following command as it would appear if executed at the given
104144  time:
104145  date "+%b %e %H:%M %Y"
104146  without the trailing <newline>, if the page being written is from standard input. If the page
104147  being written is not from standard input, in the POSIX locale, the same format shall be used, but
104148  the time used shall be the modification time of the file corresponding to file instead of the current
104149  time. When the LC_TIME locale category is not set to the POSIX locale, a different format and
104150  order of presentation of this field may be used.
-- >8 --
RATIONALE:
-- >8 --
104203  The <output of date> field in the −l format is specified only for the POSIX locale. As noted, the
104204  format can be different in other locales. No mechanism for defining this is present in this volume
104205  of POSIX.1-202x, as the appropriate vehicle is a message catalog; that is, the format should be
104206  specified as a ``message’’.
-- >8 --
(the -l thing appears to be an error).

Why, then:
-- >8 --
$ echo  | pr -f


2023-04-25 23:16                                                  Page 1




$ echo  | LC_ALL=C pr -f


2023-04-25 23:16                                                  Page 1




$ echo  | LC_ALL=POSIX pr -f


2023-04-25 23:16                                                  Page 1