This commit is contained in:
garnier-quentin 2020-02-13 15:50:39 +01:00
parent dc74f41988
commit c34f263b1d
1 changed files with 2 additions and 2 deletions

View File

@ -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,