LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-05-2013, 04:37 PM   #1
petekat03
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Rep: Reputation: 1
List long format mixed date formats


Hi all,

Something I've noticed for years is that when you list a directory in the long format, I get some files showing time instead of year in the same column.

Why does it vary between year and time?

Thanks,

Pete
Attached Thumbnails
Click image for larger version

Name:	list.jpg
Views:	26
Size:	14.0 KB
ID:	11768  
 
Old 02-05-2013, 05:05 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
When a file is less than a year old only the date and time is displayed because that is unambiguous. Long standing Unix tradition.

jlinkels
 
Old 02-05-2013, 05:11 PM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quoted from info ls (formatting file timestamps section):
Code:
By default, file timestamps are listed in abbreviated form.  Most
locales use a timestamp like `2002-03-30 23:45'.  However, the default
POSIX locale uses a date like `Mar 30  2002' for non-recent timestamps,
and a date-without-year and time like `Mar 30 23:45' for recent
timestamps.

   A timestamp is considered to be "recent" if it is less than six
months old, and is not dated in the future.  If a timestamp dated today
is not listed in recent form, the timestamp is in the future, which
means you probably have clock skew problems which may break programs
like `make' that rely on file timestamps.
 
1 members found this post helpful.
Old 02-05-2013, 05:52 PM   #4
petekat03
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Original Poster
Rep: Reputation: 1
Thanks for the info
 
Old 02-05-2013, 05:56 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
One of the few traditions I could do without so my 'ls' alias has the "--full-time --time-style=long-iso" switches.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to change Thunderbird's date format in Date column LXer Syndicated Linux News 0 07-18-2012 02:11 AM
ls -l showing different date formats SmurfGGM Linux - Newbie 5 12-16-2008 04:26 PM
Regarding date Format ancys Programming 4 08-10-2006 05:35 AM
C++ list of mixed classes martinrp Programming 11 03-13-2006 12:00 PM
ELF format and other formats? Manish Programming 3 02-25-2002 08:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration