in reply to localtime - make the date format different?

#!/usr/bin/perl use strict; use warnings; use File::stat; use DateTime; my $file = '/home/you/test.txt'; my $st = stat($file) or die "No $file: $!"; my $dt = DateTime->from_epoch( epoch => $st->mtime ); print $dt->ymd, ' ', $dt->hms;


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Replies are listed 'Best First'.
Re^2: localtime - make the date format different?
by ikegami (Patriarch) on Dec 22, 2008 at 13:11 UTC
    The OP wanted the local time, so you need to add time_zone => 'local' to the constructor.