src/Marando/AstroDate/AstroDate.php
public function add(Time $t)
    {
        // Interval to add as days
        $td = $t->days;

        // Days (jda) and day fraction (dfa) to add
        $jda = intval($td);
        $dfa = $this->dayFrac + $td - $jda;

        // Handle the event that the day fraction becomes negative
        if ($dfa < 0) {
            $dfa += 1;
            $jda -= 1;
        }

        // Additional day to add from above day frac in excess of 1 day
        $jda1 = intval($dfa);

        // Since additional day has been added, modulate day frac to range 0-1
        $dfa = fmod($dfa, 1);

        // Add the intervals
        $this->jd      = $this->jd + $jda + $jda1;
        $this->dayFrac = $dfa;

        return $this;
    }
public function add(Time $t)
    {
        // Interval to add as days
        $td = $t->days;

        // Days (jda) and day fraction (dfa) to add
        $jda = intval($td);
        $dfa = $this->dayFrac + $td - $jda;

        // Handle the event that the day fraction becomes negative
        if ($dfa < 0) {
            $dfa += 1;
            $jda -= 1;
        }

        // Additional day to add from above day frac in excess of 1 day
        $jda1 = intval($dfa);

        // Since additional day has been added, modulate day frac to range 0-1
        $dfa = fmod($dfa, 1);

        // Add the intervals
        $this->jd      = $this->jd + $jda + $jda1;
        $this->dayFrac = $dfa;

        return $this;
    }
Adds a Time interval to this instance

@param  Time $t

@return static