Bug 21395: Fix QA errors
[koha.git] / misc / migration_tools / 22_to_30 / export_Authorities_xml.pl
index c8a5aa9..6c91708 100755 (executable)
@@ -30,7 +30,9 @@ open my $fileoutput, '>:encoding(UTF-8)', "./$filename/$authid.xml" or die "unab
                        
 #  if (C4::Context->preference('marcflavour') eq "UNIMARC"){
        $record->leader('     nac  22     1u 4500');
-    my $string = ($time=~m/([0-9\-]+)/) ? $1 : undef
+    my @time = localtime(time);
+    my $time = sprintf('%04d%02d%02d', $time[5] + 1900, $time[4] + 1, $time[3]);
+    my $string = ($time=~m/([0-9\-]+)/) ? $1 : undef;
     $string=~s/\-//g;
      $string = sprintf("%-*s",26, $string);
      substr($string,9,6,"frey50");