Returns a copy of this ZonedDateTime with the specified period in months added.

@param int $months

@return ZonedDateTime
513394
public function plusMonths(int $months) : ZonedDateTime
    {
        return ZonedDateTime::of($this->localDateTime->plusMonths($months), $this->timeZone);
    }
1088678
public function daysInMonth($year, $month)
    {
        if ($year === 0) {
            throw new InvalidArgumentException('Year ' . $year . ' is invalid for this calendar');
        } elseif ($month < 1 || $month > 12) {
            throw new InvalidArgumentException('Month ' . $month . ' is invalid for this calendar');
        } elseif ($month === 1 || $month === 3 || $month === 5 || $month === 7 || $month === 8 || $month === 10 || $month === 12) {
            return 31;
        } elseif ($month === 4 || $month === 6 || $month === 9 || $month === 11) {
            return 30;
        } elseif ($this->isLeapYear($year)) {
            return 29;
        } else {
            return 28;
        }
    }
1003846
public function withYears(int $years) : Period
    {
        if ($years === $this->years) {
            return $this;
        }

        return new Period($years, $this->months, $this->days);
    }
957744
public function getPeriod($period, $mode = self::DAYS_ONLY)
    {
        $result = $this->parsePeriod($period);

        if ($result['max'] && $mode == self::DAYS_AND_TIME) {
            $result['max']->modify("+1 day -1 second");
        }

        foreach ($result as $key => $value) {
            if (!$value) {
                unset($result[$key]);
            } elseif ($mode == self::DAYS_ONLY) {
                $result[$key] = new DateTime($result[$key]->format('Y-m-d'), $this->getTimezoneTo());
            } elseif ($this->getTimezoneTo()) {
                $result[$key]->setTimezone($this->getTimezoneTo());
            }
        }

        return $result;
    }
2021
public function getDays(Month $month)
    {
        $days = array();

        for ($dayNo = 1; $dayNo <= $month->numberOfDays(); $dayNo++) {
            $days[$dayNo] = $this->getDay($month, $dayNo);
        }

        return $days;
    }
1234703
public static function getMonthFullname($month)
    {
        $month = (int) $month;
        $names = self::getMonthNames();
        return $names[$month];
    }
307744
public function months($months)
    {
        return sprintf($this->formatPattern, $months, $this->month_words[$this->pluralization($months)]);
    }
487126
public function plusMonths(int $months) : Period
    {
        if ($months === 0) {
            return $this;
        }

        return new Period($this->years, $this->months + $months, $this->days);
    }
1219801
public static function getMonthEnd($month = -1, $year = -1)
    {
        if ($month == -1) {
            $month = date("n");
        }
        if ($year == -1) {
            $year = date("Y");
        }

        //gets the number of days in the actual month
        $tempTime = mktime(0, 0, 0, $month, 1, $year);
        $tempTime = date("t", $tempTime);

        return mktime(23, 59, 59, $month, $tempTime, $year);
    }
977576
public static function monthStringToNumber($month)
    {
        $monthIndex = 1;
        foreach (self::$monthNames as $shortMonthName => $longMonthName) {
            if (($month === $longMonthName) || ($month === $shortMonthName)) {
                return $monthIndex;
            }
            ++$monthIndex;
        }
        return $month;
    }
534165
public final function addSeconds( int $seconds = 1 )
      : DateTime
   {

      return $this->move( new \DateInterval( 'PT' . \abs( $seconds ) . 'S' ), $seconds < 0 );

   }
436941
public function withDays(int $days) : Period
    {
        if ($days === $this->days) {
            return $this;
        }

        return new Period($this->years, $this->months, $days);
    }
757422
public static function createFromMonth($year, $month)
	    {
	        $year  = self::validateYear($year);
	        $month = self::validateRange($month, 1, 12);

	        return self::createFromDuration($year.'-'.sprintf('%02s', $month).'-01', '1 MONTH');
	    }
642040
public static Date plusMonths(Date date, int months) {
		return plus(date, months, DateTimeField.MONTH);
	}
758189
public function minusDays(int $days) : Period
    {
        if ($days === 0) {
            return $this;
        }

        return new Period($this->years, $this->months, $this->days - $days);
    }
14280
public function addMonths($n)
    {
        $an = abs($n);
        $years = floor($an / 12);
        $months = $an % 12;

        if ($n < 0) {
            $this->year -= $years;
            $this->month -= $months;
            if ($this->month < 1) {
                $this->year--;
                $this->month = 12 + $this->month;
            }
        } else {
            $this->year += $years;
            $this->month += $months;
            if ($this->month > 12) {
                $this->year++;
                $this->month -= 12;
            }
        }

        return $this;
    }
327625
public static function thisMonth($timeZone = null)
    {
        $now = null;
        $before = null;
        if ( is_null($timeZone) ) {
            $now = new \DateTime();
            $before = new \DateTime();
        } else {
            $now = new \DateTime( "now", new \DateTimeZone( $timeZone ) );
            $before = new \DateTime( "now", new \DateTimeZone( $timeZone ) );
        }
        $dayOfMonth = $now->format( "j" );
        $offset = $dayOfMonth - 1;
        $before->modify( "-$offset day" );
        $range = new Range( $before, $now );

        return $range;
    }