[m-dev.] diff: w3 y2k bug fix
Peter Ross
petdr at cs.mu.OZ.AU
Mon Dec 6 13:56:27 AEDT 1999
Hi,
Our first y2k bug fix?
===================================================================
Estimated hours taken: 0.5
include/list.inc:
The mailing list archives are in the form archive.yymm, so the
script that handled then dealt with the years in terms of yy.
Apparently next month this will cause problems :).
Index: include/list.inc
===================================================================
RCS file: /home/staff/zs/imp/w3/mailing-lists/include/list.inc,v
retrieving revision 1.3
diff -u -r1.3 list.inc
--- list.inc 1999/12/02 02:21:01 1.3
+++ list.inc 1999/12/06 02:44:05
@@ -1,11 +1,11 @@
<?
$mo=1;
-$yr=date("y");
+$yr=date("Y");
$current_month=date("m");
$current_year=date("y");
-$year=97;
+$year=1997;
$cols=3;
$width=(int)(100/$cols);
@@ -24,8 +24,7 @@
while ($yr >= $year)
{
- $year_string=date("Y", mktime(0,0,0,$mo,1,$yr));
- echo "<H3>$year_string</H3>";
+ echo "<H3>$yr</H3>";
echo "<TABLE width=\"100%\">";
$i=1;
@@ -37,7 +36,8 @@
break;
}
- $yrmo=sprintf("%02d%02d", $yr, $mo);
+ $year_2digits=date("y", mktime(0,0,0,$mo,1,$yr));
+ $yrmo=sprintf("%02d%02d", $year_2digits, $mo);
$month_string=date("F", mktime(0,0,0,$mo,1,$yr));
if ($i == 1)
----
+----------------------------------------------------------------------+
| Peter Ross M Sci/Eng Melbourne Uni |
| petdr at cs.mu.oz.au WWW: www.cs.mu.oz.au/~petdr/ ph: +61 3 9344 9158 |
+----------------------------------------------------------------------+
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list