Conversion
|
|
|
|
<?php /*
ddate. Converts the current date to Discordian.
Much like the ddate program on *nix systems.
Except that there's no date formatting.
And it only does the current date.
It suits my needs. So there.
ns@niallsheridan.com || www.frogurt.org
61 Discord 3168
*/
function ddate() {
$season_list=array("Chaos", "Discord", "Confusion", "Bureaucracy", "The Aftermath");
$day_list=array("Sweetmorn", "Boomtime", "Pungenday", "Prickle-Prickle", "Setting Orange");
$a_holiday=array("Mungday", "Mojoday", "Syaday", "Zaraday", "Maladay"); // Apostle holidays. Occur on 5th of every season.
$s_holiday=array("Chaoflux", "Discoflux", "Confuflux", "Bureflux", "Afflux");// Seasonal holidays. Occur on 50th day of season
$now=getdate();
$dyear=$now["year"]+1166;//Convert current year to Discordian year.
$yday=$now["yday"];
$mon=$now["mon"];
$mday=$now["mday"];
$dseason=(int)($yday/73);
$name_season=$season_list[$dseason];
$dday=($yday-(73*$dseason))+1;
$fizz=$dday%10;
switch ($fizz) {
case 1:
$dday.="st";
break;
case 2:
$dday.="nd";
break;
case 3:
$dday.="rd";
break;
default:
$dday.="th";
}
$dweekday=$day_list[($yday%5)];
$ddate=$dweekday.", ".$dday." ".$name_season.", ".$dyear.".";
if ($dday==5) {
$ddate.=" Celebrate ".$a_holiday[$dseason].".";
}elseif ($dday==50) {
$ddate.=" Celebrate ".$s_holiday[$dseason].".";
}elseif ($mon==2 && $mday==29) {
$ddate="Celebrate St. Tib's Day";//Hurrah!
}
echo $ddate;
//That is all.
//Thank you, come again. } ?>
|
|
|
Usage Example
|
|
|
Rate This Script
|
|
|
|