fix dat dagen altijd 2 chars moeten zijn

This commit is contained in:
Ward Wouts 2003-02-03 15:57:30 +00:00
parent 91f90b825f
commit 84fca7e6ae

View file

@ -36,6 +36,7 @@ sub backup($) {
@stat = stat($file); @stat = stat($file);
@timestamp = localtime($stat[9]); @timestamp = localtime($stat[9]);
$timestamp[5] += 1900; $timestamp[5] += 1900;
if ( length($timestamp[3]) < 2 ) { $timestamp[3] = "0$timestamp[3]"; }
$sfx = "$timestamp[3]$months[$timestamp[4]]$timestamp[5]"; $sfx = "$timestamp[3]$months[$timestamp[4]]$timestamp[5]";
unless ( -d "$dir/OLD" ) { mkdir "$dir/OLD", 0777 or die "Couldn't create $dir/OLD: $!\n"; } unless ( -d "$dir/OLD" ) { mkdir "$dir/OLD", 0777 or die "Couldn't create $dir/OLD: $!\n"; }
$backup = "$dir/OLD/$base.$sfx"; $backup = "$dir/OLD/$base.$sfx";