Commit a0f3e37e authored by Steve McIntyre's avatar Steve McIntyre

Simplify the built-time code massively and make it correct

Stop trying to use the GEN_TIME stuff, and just use gmtime() directly.
parent 319d7dcd
......@@ -124,31 +124,8 @@ $rangeform_severalmonths =~ s/\[%\]/%/g;
# This function creates a last *built* time stamp for a web page.
sub webwml_built_time {
my ($time, $sec, $min, $hour, $mday, $monnr, $year, $wday, $yday, $isdst, $mon);
# The last modification time of inputfile in ISO dd-mm-yyyy hh:mm:ss format.
if (defined $(GEN_TIME)) {
$WML_GEN_ISOTIME =~ /(\d+)-(..)-(\d+) (..):(..):(..)/;
if ($1 <= 31) { # for WML 1.x
$time = timelocal($6, $5, $4, $1, $2-1, $3);
} else { # for WML 2.x
$time = timelocal($6, $5, $4, $3, $2-1, $1);
}
# $lday=$1; $lmon=$2; $lyear=$3; $lhr=$4; $lmin=$5; $lsec=$6;
# if ($lyear > 19000) { $lyear = 1900+($lyear-19000); }
# $time = timelocal($lsec, $lmin, $lhr, $lday, $lmon-1, $lyear);
}
else {
$WML_SRC_ISOTIME =~ /(\d+)-(..)-(\d+) (..):(..):(..)/;
if ($1 <= 31) { # for WML 1.x
$time = timelocal($6, $5, $4, $1, $2-1, $3);
} else { # for WML 2.x
$time = timelocal($6, $5, $4, $3, $2-1, $1);
}
# $lday=$1; $lmon=$2; $lyear=$3; $lhr=$4; $lmin=$5; $lsec=$6;
# if ($lyear > 19000) { $lyear = 1900+($lyear-19000); }
# $time = timelocal($lsec, $lmin, $lhr, $lday, $lmon-1, $lyear);
}
($sec, $min, $hour, $mday, $monnr, $year, $wday, $yday, $isdst) = gmtime($time);
my ($sec, $min, $hour, $mday, $monnr, $year, $wday, $yday, $isdst, $mon);
($sec, $min, $hour, $mday, $monnr, $year, $wday, $yday, $isdst) = gmtime();
$wday = $dow[$wday];
$mon = $moy[$monnr];
return eval("sprintf($dateform)");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment