in reply to Re: localtime - make the date format different?
in thread localtime - make the date format different?

haha always the simple things :D
my @stats = stat("$folder/$file"); my @date = split / /, localtime $stats[9]; my $date = qq|$date[4] $date[1] $date[2] $date[3]|;


Thanks for the tip =)

Cheers

Andy

Replies are listed 'Best First'.
Re^3: localtime - make the date format different?
by jwkrahn (Abbot) on Dec 22, 2008 at 10:54 UTC

    That won't work correctly at the beginning of the month.

    $ perl -le' my @date = split / /, localtime 1228636800; print qq|$date[4] $date[1] $date[2] $date[3]|; ' 00:00:00 Dec 7