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

Re: File systems' timestamps apparently formatted in a wrong way ...



In <[🔎] AANLkTinS-QFS4h+LazyfnJMNB9FxrgAqcTympkVZ0Obu@mail.gmail.com>, Albretch 
Mueller wrote:
> ls -lR
>
> but not all timestamps are formatted the same. You get them as, say,
>"Mar 24 2004", but also as "Dec 26 09:55" (without the year!) and they
>are (or seem to be) files in the same directory
>
> Why would that be?

From the Single Unix Specification version 2:
"If the -l option is specified, the following information will be written:

"%s %u %s %s %u %s %s\n", <file mode>, <number of links>, <owner name>, <group 
name>, <number of bytes in the file>, <date and time>, <pathname>"

"The <date and time>, field will contain the appropriate date and timestamp of 
when the file was last modified. In the POSIX locale, the field is 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 characters 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, except that, in both cases, the final newline character produced by 
date is not included and the output is as if the date command were executed at 
the time of the last modification date of the file rather than the current 
time. When the LC_TIME locale category is not set to the POSIX locale, a 
different format and order of presentation of this field may be used."
-- 
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
bss@iguanasuicide.net                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: