From f2e93268d76cdee815a4f69da27cba5263b07031 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Mon, 8 Aug 2016 14:00:42 +0200 Subject: [PATCH] Allow timezone spec without minutes --- TimeSeries.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {