use regexp instead of Date parser

This commit is contained in:
Shini31 2015-07-24 12:48:44 +02:00
parent 50dcd19cec
commit b9e815010d
1 changed files with 2 additions and 3 deletions

View File

@ -41,7 +41,6 @@ use strict;
use warnings;
use centreon::plugins::httplib;
use JSON;
use DateTime::Format::ISO8601;
my $thresholds = {
state => [
@ -182,8 +181,8 @@ sub run {
$result = $keys;
$containername = $webcontent->{Name};
$containername =~ s/^\///;
my $dt = DateTime::Format::ISO8601->parse_datetime($webcontent->{State}->{StartedAt});
$containertime = $dt->strftime('%F %T');
my ( $y, $m, $d, $h, $mi, $s ) = $webcontent->{State}->{StartedAt} =~ /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/;
$containertime = $y."-".$m."-".$d." ".$h.":".$mi.":".$s;
last;
}
}