cide
asked on
Easiest way to show date a file was created on.
Hi,
What is the easist way to show the date a file was created on?
Thanks in Advance.
What is the easist way to show the date a file was created on?
Thanks in Advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Number of days since it was last modified would be
-M $filename
a readable date would be
scalar localtime((stat $filename)[9])
-M $filename
a readable date would be
scalar localtime((stat $filename)[9])
ozo, are you sure that -M works on win32? I had thought that there might be bugs with it...
It seems to work the same as ($^T-(stat $filename)[9])/(60*60*24)
What version are you using?
What version are you using?
ASKER
Then you do you use Date::Manip?
What do you want to do with Date::Manip?
perldoc Date::manip
Look at UnixDate
Look at UnixDate
ASKER
I want to show dd/mm/yy.
($d,$m,$y) = (localtime((stat $filename)[9]))[3,4,5];
$m+=1; $y+=1900;
printf("%02d/%02d/%d\n",$d ,$m,$y);
use Date::Manip;
print &UnixDate(scalar localtime((stat $filename)[9]),"%d/%m/%Y") ;
$m+=1; $y+=1900;
printf("%02d/%02d/%d\n",$d
use Date::Manip;
print &UnixDate(scalar localtime((stat $filename)[9]),"%d/%m/%Y")
use POSIX;
print strftime"%d/%m/%Y",localti me((stat $filename)[9]);
print strftime"%d/%m/%Y",localti
ASKER
Thank you would you like the points ozo?
ASKER