I am using Net::SFTP. My intention is to list the files along with their modified date. I am able to list the files with date in UTC format. I need in the EDT format. Is there any setting available?
Presently, I am using Perl 5 on Linux.
my $sftp = Net::SFTP->new($host, %args) or die "Cannot connect to $@";
$sftp->ls('.' , sub { print $_[0]->{longname}, "\n" });
If my understanding is correct, longName field of the listing is server-rendered and obsolete / not recommended for use. SFTP provides a structure with data for each directory entry, and times are listed there in UTC.
From documentation:
So you need to get those a object and use its atime and mtime fields. Once you have them, converting them to local time zone should be trivial if you need a fixed timezone.