Subject: Re: ls(1) and dates in the future
To: None <tech-userlevel@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 08/08/2004 17:46:03
On Fri, Aug 06, 2004 at 03:45:09PM -0400, Jan Schaumann wrote:
> Hi,
>
> For the way ls(1) should display the dates, SUSv3 says:
>
> | The <date and time> field shall contain the appropriate date and
> | timestamp of when the file was last modified. In the POSIX locale, the
> | field shall be the equivalent of the output of the following date
> | command:
> |
> | date "+%b %e %H:%M"
> |
> | if the file has been modified in the last six months, or:
> |
> | date "+%b %e %Y"
> |
> | (where two <space>s are used between %e and %Y ) if the file has not
> | been modified in the last six months or if the modification date is in
> | the future
Bah, how did that get into the standard....
(Mandating the existing behaviour without deciding whether anythig else
is actually more sensible.)
If a file has a timestamp that is in the 'near future', you need to know
how far into the future it is, so need the hours and minutes.
>
> Our ls(1), however, displays dates for files that are less than six
> months in the future as normal:
Seems sane to me...
FWIW the behaviour of ls was changed in rev 1.20...
David
--
David Laight: david@l8s.co.uk