From 114db9a8388cfda7f293a2ac3354ad39818f3488 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 10 Apr 2009 22:07:41 +0000 Subject: Bug 487865: Exporting bugs in XML format uses non-unique timezones (they cannot be imported back) - Patch by Frédéric Buclin r=ghendricks a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Util.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Bugzilla/Util.pm') diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 398957b13..7ed20c875 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -426,6 +426,13 @@ sub format_time { # strptime($date) returns an empty array if $date has an invalid date format. my @time = strptime($date); + unless (scalar @time) { + # If an unknown timezone is passed (such as MSK, for Moskow), strptime() is + # unable to parse the date. We try again, but we first remove the timezone. + $date =~ s/\s+\S+$//; + @time = strptime($date); + } + if (scalar @time) { # Fix a bug in strptime() where seconds can be undefined in some cases. $time[0] ||= 0; -- cgit v1.2.3-24-g4f1b