I have a simple script that I need to return the timestamp of files as YYYY-MM-DD. Im using HTTP:ate but it's returning more than I need. Is there a way to further format the date easily?
Thanks..
Code:
#!/usr/bin/perl -w
use File::stat;
use Time::localtime;
use Time::Zone;
use HTTP::Date qw(parse_date time2str);
chomp(@ARGV = <STDIN>) unless @ARGV;
for ( @ARGV )
{
$date_string = parse_date(ctime(stat($_)->mtime));
print "file $_ updated at $date_string\n";
}
Thanks..