--- Gordon Stewart <[EMAIL PROTECTED]> wrote:

> Why does the 1st one appear as "Mar 9 2007"  & the others have "Mar 9
> & then the time they were modified ??
> 
> (those two files were updated MONTHS ago - I modified the intro file
> today (just to check)...  - However it changed to '2007' - but still
> shows MAR 9 ???? )
> 
> 
> QUESTION :-
> 
> 1)
> 
> Is there a way to change :- $t=`ls -l -t *.txt`;
> 
> - but to show a consistent format for ALL files - regardless of if
> they were modified 5 minutes ago, or 5 months ago....
> 
> 2) PS I want to show them in descending order (from modified time) - I
> think thats how it is already... )
> 
> -- 
> G

Since PHP has functions to open a directory and loop through the files and see
aspects of the file such as mtime, etc., why not use them instead of the
Unix/Linux commands which may have slight variations from system to system and
among different files.

That said, you might want to look at some of the options for the ls command
such as:

ls -lTt

(that's lower-case L followed by capital T followed by lower-case T)

On my system that yields output like:

drwx------  41 keeline  keeline   1394 16 Jan 18:31:14 2007 Music
-rw-r--r--   1 keeline  keeline  30353  5 Oct 22:58:03 2006 20051226.jpg

You can see that the date fields hold day, month, hour, minute, seconds, year.

James Keeline

Reply via email to