The most standard way is to use the POSIX module and the strftime function.
use POSIX qw( strftime );
use File::stat;
my $stat_epoch = stat( 'some_file.name' )->ctime;
print strftime('%Y-%m-%d %H:%M:%S', localtime( $stat_epoch ) );
All of these markers, such as% Y,% m, etc., are defined in the standard and work identically in the C command, system "date" (at least on Unix), etc.
user80168
source
share