Tuesday, 10 September 2013

PERL how to convert localtime format to datetime format

PERL how to convert localtime format to datetime format

so I am currently using
my $date = DateTime->now->mdy;
which gives me the format in "09-10-2013"
then i used
my $modTime = localtime((stat($some_file))[9]);
which gives me the date in format "Tue Sep 10 15:29:29 2013"
is there a way built in perl to format the $modTime to the format like
$date? or do i have to do it manually?
thanks!

No comments:

Post a Comment