0)) $IsLeap =1;
if ($usery%400 == 0) $IsLeap = 1;
}
// We need to know the total number of days in the year so far
$userdays = 0;
$i = 0;
while ($i < ($userm-1)) {
$userdays = $userdays + $Anerisia[$i];
$i = $i +1;
}
$userdays = $userdays + $userd;
// We can now work out the full discordian date for most dates
// PHP does not do integer division, so we use 73.2 as a divisor
// the value 73.2 works, larger values cause an off-by-one on season
// changes for the later seasons .
// This is not needed with the mod operator.
$IsHolyday = 0;
$dyear = $usery + 1166;
$dmonth = $MONTHS[$userdays/73.2];
$dday = $userdays%73;
if (0 == $dday) $dday = 73;
$Dname = $DAYS[$userdays%5];
$Holyday = "St. Tibs Day";
if ($dday == 5) {
$Holyday = $Holy5[$userdays/73.2];
$IsHolyday =1;
}
if ($dday == 50) {
$Holyday = $Holy50[$userdays/73.2];
$IsHolyday =1;
}
if (($IsLeap ==1) && ($userd ==29) and ($userm ==2)) $IsHolyday = 2;
// work out the suffix to the day number
$suff = $Dsuff[$dday%10] ;
if ((11 <= $dday) && (19 >= $dday)) $suff='th';
// code to display the date ...
if ($IsHolyday ==2)
echo "Celeberate ",$Holyday," ",$dmonth," YOLD ",$dyear;
if ($IsHolyday ==1)
echo "Celeberate for today ", $Dname , " The ", $dday,"",$suff,"", " day of ", $dmonth , " YOLD " , $dyear , " is the holy day of " , $Holyday;
if ($IsHolyday == 0)
echo "Today is " , $Dname , " the " , $dday ,"",$suff, " day of " , $dmonth , " YOLD " , $dyear;
?>