bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls default time style


From: Paul Eggert
Subject: Re: ls default time style
Date: Mon, 10 Dec 2001 14:46:46 -0800 (PST)

[I'm adding Markus Kuhn to the CC: list, as he's my inspiration for
 having GNU 'ls' use ISO 8601 date format by default outside the POSIX locale.
 (And he knows German better than I do.  :-)]

> From: Bruno Haible <address@hidden>
> Date: Mon, 10 Dec 2001 14:16:50 +0100 (CET)

> Starting with fileutils-4.1.1, "ls -l" in a German locale produces output
> like this:...
> 
> -rw-r--r--    1 bin     bin      2188323 12-03 00:00 fileutils-4.1.3.tar.gz
> -rw-r--r--    1 bin     bin      1812537 2001-04-29  fileutils-4.1.tar.gz
> 
> This date format HAS NEVER BEEN SEEN in Germany and is totally
> unintelligible to any user.

This is exaggerating somewhat.  A brief web search indicates that the
following German-language web pages use ISO 8601 format.  (Please
excuse my lack of umlauts.)

   home page of Prof. Dr. Dr. h.c. mult. Peter Mertens, U. Erlangen-Nuremberg
   http://www.wi1.uni-erlangen.de/personal/mertens/

   home page of Prof. Dr. J. Becker, U. Muenster
   http://www-wi.uni-muenster.de/is/mitarbeiter/person.cfm?name=isjobe

   Hofmann Software Engineering International
   (specializing in calendrical calculations)
   http://www.hofmann-int.de/index.shtml.de

I got tired after finding these examples, but I'm sure I could find
others.  I don't deny that ISO 8601 format is uncommon in ordinary
German text (just as it is uncommon in ordinary English text), but I
can't agree that it is never used, or that it is "totally
unintelligible to any user".


> 1) It's a question of usability.

Yes, it's very much a question of what should be the default outside
the POSIX locale.  In practice, the old default led to some real
problems, as the dates got too long and were too hard to parse
automatically.  Please see GNU Emacs's dired-move-to-filename-regexp
for one example of the hassle involved in parsing natural-language dates.


> 2) This is also what POSIX (draft6, p. 2772, line 21980) says:
> 
>    "LC_TIME Determine the format and contents for date and time strings
>     written by ls."

But LC_TIME *does* determine the format and contents, in an
implementation-defined way.  That is all that POSIX requires.

POSIX 1003.1-2001 says in draft 7, section 8.2, page 161, lines 5654-5656:

  LC_TIME This variable shall determine the locale category for date
          and time formatting information. It affects the behavior of
          the time functions in strftime().  Additional semantics of
          this variable, if any, are implementation-defined.

The last sentence is what counts here.  The effect of LC_TIME on `ls'
is implementation-defined.  And if you look at the definition of
LC_TIME in section 7.3.5.1, you will find that there is no provision
for specifying the output format of 'ls' -- so there is no portable
way for `ls' to divine the format even if it wanted to, if we assume
the POSIX API.

So it's not a POSIX conformance issue.  It's just an issue of what the
default behavior should be.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]