diff --git a/TimeSeries.pm b/TimeSeries.pm index 1206403..3759090 100644 --- a/TimeSeries.pm +++ b/TimeSeries.pm @@ -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 {