summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Util.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-04-11 00:07:41 +0200
committerlpsolit%gmail.com <>2009-04-11 00:07:41 +0200
commit114db9a8388cfda7f293a2ac3354ad39818f3488 (patch)
treeb6d04378895d0b58f872f03d37ce2a16e69d7b63 /Bugzilla/Util.pm
parent461d51d5078bd9971593296dbc35d3e37e48df9b (diff)
downloadbugzilla-114db9a8388cfda7f293a2ac3354ad39818f3488.tar.gz
bugzilla-114db9a8388cfda7f293a2ac3354ad39818f3488.tar.xz
Bug 487865: Exporting bugs in XML format uses non-unique timezones (they cannot be imported back) - Patch by Frédéric Buclin <LpSolit@gmail.com> r=ghendricks a=LpSolit
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r--Bugzilla/Util.pm7
1 files changed, 7 insertions, 0 deletions
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;