This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LC_TIME: date_fmt vs d_t_fmt


On 10 Apr 2016 21:23, J William Piggott wrote:
> On 04/10/2016 01:40 AM, Mike Frysinger wrote:
> > the `date` command will default to the LC_TIME.date_fmt field.  it does
> > this by looking up nl_langinfo(_DATE_FMT) (iff _DATE_FMT is defined).
> > if that isn't available, it falls back to the default:
> > 	%a %b %e %H:%M:%S %Z %Y
> > this is required by POSIX for the POSIX locale, but works generally too.
> > 	http://pubs.opengroup.org/onlinepubs/9699919799/utilities/date.html#tag_20_30_10
> > 
> > the GNU coreutils date code lives here (as does all this logic):
> > 	http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/date.c
> > 
> > the LC_TIME.date_fmt was first added to glibc here:
> > 	https://sourceware.org/ml/libc-alpha/2000-10/msg00298.html
> > 	https://sourceware.org/git/?p=glibc.git;a=commit;h=d8337213c83c3bd4aa32e16669745dd7ee32b329
> > 
> > it quoted the XPG4 standard for the background.  i haven't been able to
> > locate that old standard, but all the ones i do have access to (SuSv2
> > and newer) do not mention _date_fmt or date_fmt anywhere that i can find.
> > 
> > we get a steady stream of complaints (some in our bugzilla, but via other
> > sources as well like the mailing list or distro users) that the output of
> > `date` does not match their expectations.  in the end, they end up saying
> > that want something that looks very much like `date +%c` which is what the
> > LC_TIME.d_t_fmt field is set to.
> > 
> > so what should we do here ?  we provide 0 guidance to locale writers which
> > means we get inconsistent behavior across locales.  options:
> > (1) punt date_fmt entirely (so `date` uses the POSIX default everywhere)
> 
> That will not satisfy the complaints requesting %c.

while true, it makes it "not our problem" anymore.  we don't export
DATE_FMT which means any complaints that come to us wrt `date` we
redirect to the people actually implementing `date`.

it seems odd that the C library would even be dictating exact formats
for single system utilities in the first place.  the date_fmt field
is not used by any thing else.
-mike

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]