my @time = strptime($date);
if (scalar @time) {
+ # Fix a bug in strptime() where seconds can be undefined in some cases.
+ $time[0] ||= 0;
+
# strptime() counts years from 1900, and months from 0 (January).
# We have to fix both values.
my $dt = DateTime->new({year => 1900 + $time[5],
my $comments;
$comments .= "\n\n--- Bug imported by $exporter_login ";
- $comments .= format_time(localtime(time()), '%Y-%m-%d %H:%M %Z') . " ";
+ $comments .= format_time(scalar localtime(time()), '%Y-%m-%d %R %Z') . " ";
$comments .= " ---\n\n";
$comments .= "This bug was previously known as _bug_ $bug_fields{'bug_id'} at ";
$comments .= $urlbase . "show_bug.cgi?id=" . $bug_fields{'bug_id'} . "\n";