From 1d3ab4fee5071def96767a3808f7366e2d8570a1 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 12 Mar 2017 11:19:13 +0100 Subject: 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 --- lib/App/BorgRestore.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') 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 { -- cgit v1.2.3-24-g4f1b