我正在制作一个在线日历,暂时只根据我朋友圈从头开始创建的日历显示当前日期,只有一些注意力集中在公历上。我到目前为止的代码是计算5天工作日中的哪一天,以及如何计算其余日历的代码如下。我不知道到目前为止我编码的内容是否有效,甚至是正确的,更不用说如何继续计算几个星期和几个月了。
<?php
echo "<p><p><p> According to the Gregorian Calender, ";
echo "today is " . date("Y/m/d") . "<br>";
$d1=strtotime("October 18, 2015");
$d2=ceil(($d1-time())/60/60/24);
echo "<p>There are " . $d2 ." days since First Founding, First Sol.<p>";
if ($d2 < "365") { $lastdigit = $d2%10; }
echo "$lastdigit <br>";
if ($lastdigit == "-1") { echo "Today is Mercury."; }
if ($lastdigit == "-2") { echo "Today is Venus."; }
if ($lastdigit == "-3") { echo "Today is Terra."; }
if ($lastdigit == "-4") { echo "Today is Mars."; }
if ($lastdigit == "-5") { echo "Today is Sol."; }
if ($lastdigit == "-6") { echo "Today is Mercury."; }
if ($lastdigit == "-7") { echo "Today is Venus."; }
if ($lastdigit == "-8") { echo "Today is Terra."; }
if ($lastdigit == "-9") { echo "Today is Mars."; }
if ($lastdigit == "0") { echo "Today is Sol."; }
if ($lastdigit == "1") { echo "Today is Mercury."; }
if ($lastdigit == "2") { echo "Today is Venus."; }
if ($lastdigit == "3") { echo "Today is Terra."; }
if ($lastdigit == "4") { echo "Today is Mars."; }
if ($lastdigit == "5") { echo "Today is Sol."; }
if ($lastdigit == "6") { echo "Today is Mercury."; }
if ($lastdigit == "7") { echo "Today is Venus."; }
if ($lastdigit == "8") { echo "Today is Terra."; }
if ($lastdigit == "9") { echo "Today is Mars."; }
$year = date('Y');
$truyear = $year-1;
function is_leapyear_working($truyear) {
if((($truyear%4==0) && ($truyear%100!=0)) || $truyear%400==0) {
return true;
}
return false;
}
if(($d2 == "365") && ($is_leapyear_working == "true")) { echo "Today is Luna."; }
if(($d2 == "365") && ($is_leapyear_working == "false")) { echo "Today is Mars."; }
if ($d2 == "-29") {
echo "<p>First Apprentice, Third Mars<p>";
}
echo "*Year* (st/nd/rd/th) *Month*, *Week* (st/nd/rd) *Day*";
echo "<p> October 18, 2015 according the Gregorian Calender is the First Founding, First Sol. This is, essentially, the \"New Years Day\" of the Ecclesia Chaotica. One week within the Ecclesic Calender is Five days in length, named in order, Sol, Mercury, Venus, Terra, and Mars. There are three weeks in every month, with twenty-four months in a year, called, in order, The Founding, The Apprentice, 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24. Seventy-three weeks exist in a year, with one of said weeks existing \"outside of time.\" This week is known as the Week of Fotamacus, in honour of him, the God of Chaotic Time. On a Leap Year, every four years,* which are the Second, Sixth, Tenth, Fourteenth, etc. The Week of Fotamacus contains an extra day, dubbed Luna, which falls between Terra and Mars on that Week.<p> *The additional day every Leap Year is due to one cycle around the Sun taking 365.248 days, not a perfect 365, dates must be adjusted to account for this change.";
?>