diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-03-12 11:19:13 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-03-12 11:19:13 +0100 |
commit | 1d3ab4fee5071def96767a3808f7366e2d8570a1 (patch) | |
tree | b42bbcf765fa83e3b44c7084a0171bd8a0b475de | |
parent | 90c71f33959efd8b16f40064a99ebbed6e17f3ba (diff) | |
download | App-BorgRestore-1d3ab4fee5071def96767a3808f7366e2d8570a1.tar.gz App-BorgRestore-1d3ab4fee5071def96767a3808f7366e2d8570a1.tar.xz |
Use POSIX::strftime instead of DateTime
DateTime take forever to load (~115ms on my machine) and it's not
required here. Removing it makes the usage text appear much faster.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | lib/App/BorgRestore.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm index fb3ff26..a7bb37b 100644 --- a/lib/App/BorgRestore.pm +++ b/lib/App/BorgRestore.pm @@ -7,7 +7,6 @@ our $VERSION = "2.0.0"; use autodie; use Cwd qw(abs_path getcwd); -use DateTime; use File::Basename; use File::Path qw(mkpath); use File::Slurp; @@ -16,6 +15,7 @@ use File::Temp; use Getopt::Long; use List::Util qw(any all); use Pod::Usage; +use POSIX (); use Time::HiRes; =encoding utf-8 @@ -148,9 +148,7 @@ sub format_timestamp { my $self = shift; my $timestamp = shift; - state $timezone = DateTime::TimeZone->new( name => 'local' ); - my $dt = DateTime->from_epoch(epoch => $timestamp, time_zone => $timezone); - return $dt->strftime("%a. %F %H:%M:%S %z"); + return POSIX::strftime "%a. %F %H:%M:%S %z", localtime $timestamp; } sub timespec_to_seconds { |