public function __construct($year, $timeZone) { $this->Year = $year; $this->Offset = doubleval($timeZone / 24.0 + 0.0); $prevDongChi = 0; $solarterm = array(); SolarTerm::solarterm($this->Year, $prevDongChi, $solarterm); for ($i = 0; $i < 24; $i++) { $this->SolarTerms[$i] = LunarYear::JDtoDate($solarterm[$i] + $this->Offset); } $lun = $this->StrartLun($prevDongChi, $this->Offset); $newMoon = MoonPhase::moonphasebylunation($lun, 0); $this->NewMoons = array(); $this->NewMoons[0] = LunarYear::JDtoDate($newMoon + $this->Offset); $j = 0; while ($this->NewMoons[$j] < $this->SolarTerms[23]) { $j++; $newMoon = MoonPhase::moonphasebylunation($lun + $j, 0); $this->NewMoons[$j] = LunarYear::JDtoDate($newMoon + $this->Offset); } $this->Leap = $this->FindLeafMonth($this->NewMoons, $this->SolarTerms); }
private function CalSolarTerm($year, &$hachi) { $JDSolarTerms = array(); $solarTerms = array(); $JDDChi = 0; SolarTerm::solarterm($year, $JDDChi, $JDSolarTerms); for ($i = 0; $i < 24; $i++) { if ($i % 2 == 0) { $solarTerms[$i / 2] = NgayBatTu::JDtoDate($JDSolarTerms[$i] + $this->Offset); } } $hachi = NgayBatTu::JDtoDate($JDSolarTerms[11] + $this->Offset); return $solarTerms; }