summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-09-29 16:01:47 +0200
committerDaniel Friesel <derf@finalrewind.org>2013-09-29 16:01:47 +0200
commitdcdb6a9849bffa0f9148857bd08dee46176a4afa (patch)
tree25f9de28a1ca934bbf0a4d7baec0e4bbcf200041
parent61c8a0b7508bc39ef872554f0a60481f63d28934 (diff)
Use POSIX::strftime instead of Date::Format for better portability
-rw-r--r--Build.PL2
-rw-r--r--README1
-rwxr-xr-xbin/icli6
3 files changed, 3 insertions, 6 deletions
diff --git a/Build.PL b/Build.PL
index 2270e09..bb2c2f3 100644
--- a/Build.PL
+++ b/Build.PL
@@ -22,9 +22,9 @@ my $build = Module::Build->subclass(
'perl' => '5.10.0',
'autodie' => 0,
'Carp' => 0,
- 'Date::Format' => 0,
'Getopt::Long' => 0,
'List::MoreUtils' => 0,
+ 'POSIX' => 0,
'Term::ANSIColor' => 0,
'Term::Size' => 0,
},
diff --git a/README b/README
index e8644b6..c71ddc8 100644
--- a/README
+++ b/README
@@ -3,7 +3,6 @@ icli - Icinga Command Line Interface
Requires:
* A local icinga daemon + access to some of its files
* perl v5.10 or newer with the following modules:
- * Date::Format
* List::MoreUtils
* Term::Size
diff --git a/bin/icli b/bin/icli
index 7e6b0bc..9be3de2 100755
--- a/bin/icli
+++ b/bin/icli
@@ -10,9 +10,9 @@ use 5.010;
no if $] >= 5.018, warnings => "experimental::smartmatch";
use Carp qw(croak);
-use Date::Format;
use Getopt::Long qw/:config bundling/;
use List::MoreUtils qw(any firstval);
+use POSIX qw(strftime);
use Term::ANSIColor;
use Term::Size;
@@ -86,7 +86,7 @@ sub pretty_date {
return 'never';
}
- return time2str( '%Y-%m-%d %H:%M:%S', $unix );
+ return strftime( '%Y-%m-%d %H:%M:%S', localtime($unix) );
}
sub pretty_duration {
@@ -1300,8 +1300,6 @@ None.
=item * autodie (included with perl >= 5.10.1)
-=item * Date::Format
-
=item * Term::Size
=back