From c34f263b1dea901f38d559ace9f17f1a1bd0eaeb Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 13 Feb 2020 15:50:39 +0100 Subject: [PATCH] fix #1848 --- apps/backup/netapp/snapcenter/restapi/mode/jobs.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/backup/netapp/snapcenter/restapi/mode/jobs.pm b/apps/backup/netapp/snapcenter/restapi/mode/jobs.pm index d38e824ad..75e49c9dd 100644 --- a/apps/backup/netapp/snapcenter/restapi/mode/jobs.pm +++ b/apps/backup/netapp/snapcenter/restapi/mode/jobs.pm @@ -123,13 +123,13 @@ sub date2ts { my ($self, %options) = @_; return undef if (!defined($options{date}) || $options{date} eq ''); - if ($options{date} !~ /^(\d{1,2})\/(\d{1,2})\/(\d{4})\s+(\d{1,2}):(\d{1,2}):(\d{2})\s+(AM|PM)/i) { + if ($options{date} !~ /^(\d{1,2})\/(\d{1,2})\/(\d{4})\s+(\d{1,2}):(\d{1,2}):(\d{2})(?:\s+(AM|PM))?/i) { $self->{output}->add_option_msg(short_msg => "unknown date format: $options{date}"); $self->{output}->option_exit(); } my $hour = $4; - $hour += 12 if ($7 eq 'PM'); + $hour += 12 if (defined($7) && $7 eq 'PM'); my $dt = DateTime->new( year => $3, month => $1,