Link to home
Start Free TrialLog in
Avatar of cide
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.
Avatar of cide
cide

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of b2pi
b2pi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
Number of days since it was last modified would be
 -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?
Avatar of cide

ASKER

Then you do you use Date::Manip?
What do you want to do with Date::Manip?
perldoc Date::manip

Look at UnixDate

Avatar of cide

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");
use POSIX;
print strftime"%d/%m/%Y",localtime((stat $filename)[9]);
Avatar of cide

ASKER

Thank you would you like the points ozo?