Skip to content

Commit

Permalink
* Fixed a bug in anvil-generate-iso where the month was padded, then …
Browse files Browse the repository at this point in the history
…incremented, which means months in the date was behind by 1.

Signed-off-by: Digimer <[email protected]>
  • Loading branch information
Digimer committed Dec 20, 2016
1 parent 5561014 commit 44ba2e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/anvil-generate-iso
Original file line number Diff line number Diff line change
Expand Up @@ -1956,17 +1956,17 @@ sub get_date
my %time = ();
($time{sec}, $time{min}, $time{hour}, $time{mday}, $time{mon}, $time{year}, $time{wday}, $time{yday}, $time{isdst}) = localtime();

# Adjust the year and month
$time{year} = ($time{year} + 1900);
$time{mon}++;

# 0-pad the numbers
$time{pad_hour} = sprintf("%02d", $time{hour});
$time{pad_min} = sprintf("%02d", $time{min});
$time{pad_sec} = sprintf("%02d", $time{sec});
$time{pad_mon} = sprintf("%02d", $time{mon});
$time{pad_mday} = sprintf("%02d", $time{mday});

# Adjust the year and month
$time{year} = ($time{year} + 1900);
$time{mon}++;

$conf->{sys}{date} = $time{year}."/".$time{pad_mon}."/".$time{pad_mday};
$conf->{sys}{'time'} = $time{pad_hour}.":".$time{pad_min}.":".$time{pad_sec};
print "$THIS_FILE ".__LINE__."; [ Debug ] - sys::date: [$conf->{sys}{date}], sys::time: [$conf->{sys}{'time'}]\n" if $conf->{sys}{debug} >= 2;
Expand Down

0 comments on commit 44ba2e2

Please sign in to comment.