Allow timezone spec without minutes

This commit is contained in:
Peter J. Holzer 2016-08-08 14:00:42 +02:00
parent 2ef9920fd9
commit f2e93268d7
1 changed files with 2 additions and 1 deletions

View File

@ -113,7 +113,8 @@ sub add_timestring {
my $timestamp;
if (defined ($zone)) {
# adjust for timezone
my ($zs, $zh, $zm) = $zone =~ /([+-])(\d\d)(\d\d)/;
my ($zs, $zh, $zm) = $zone =~ /([+-])(\d\d)(\d\d)?/;
$zm //= 0;
$min -= ($zs eq '-' ? -1 : +1) * ($zh * 60 + $zm);
$timestamp = timegm_nocheck($sec, $min, $hour, $day, $mon-1, $year);
} else {