Returns the number of year-months in this range.

@return int The number of year-months, >= 1.
761338
public function count() : int
    {
        return 12 * ($this->end->getYear() - $this->start->getYear())
            + ($this->end->getMonth() - $this->start->getMonth())
            + 1;
    }
236649
public function calculateNextFreeNumber()
    {
        $year = (new \DateTime())->format('Y');

        /** @var \Railken\Amethyst\Models\InvoiceModel */
        $result = $this->getManager()
            ->getRepository()
            ->newQuery()
            ->where('number', 'like', '%/'.$year)
            ->orderBy(DB::raw("CAST(REPLACE(number, '/{$year}', '') AS DECIMAL(10,2))"), 'desc')
            ->first();

        $number = $result ? intval(str_replace("/{$year}", '', $result->number)) + 1 : 1;

        return $number.'/'.$year;
    }
1125566
public function getDefaultMonth()
    {
        $result = null;

        $keys = array_keys($this->getMonths());
        if (count($keys) >= 2) {
            $result = (string)$keys[1];
        }

        return $result;
    }
741557
protected function getYear()
    {
        $arrYear = array();
        $objYear = \Database::getInstance()->prepare("SELECT
                                                        FROM_UNIXTIME(`tstamp`,'%Y')  AS Y
                                                      , COUNT(`id`) AS SUMDL
                                                      FROM `tl_dlstatdets`
                                                      WHERE 1
                                                      GROUP BY Y
                                                      ORDER BY Y DESC")
                                           ->limit(12)
                                           ->execute();
        $intRows = $objYear->numRows;
        if ($intRows>0)
        {
            while ($objYear->next())
            {
                // Y, formatierte Zahl, unformatierte Zahl
                $arrYear[] = array($objYear->Y, $this->getFormattedNumber($objYear->SUMDL,0),$objYear->SUMDL );
            }
        }

        return $arrYear;
    }
277550
public function retrieveMonth($month) {
		if (!$month) {
			return 0;
		}
		$month = mb_strtolower($month);
		if (in_array($month, $this->monthList)) {
			$keys = array_keys($this->monthList, $month);
			return $keys[0] + 1;
		}
		return 0;
	}
253410
public int lengthOfYear() {

        int c = this.cycle;
        int y = this.yearOfCycle;
        y++;

        if (y > 60) {
            y = 1;
            c++;
        }

        long ny1 = this.getCalendarSystem().newYear(this.cycle, this.yearOfCycle);
        long ny2 = this.getCalendarSystem().newYear(c, y);
        return (int) (ny2 - ny1);

    }
57454
public function getYear()
    {
        if ($this->year === null) {
            $match = [];
            preg_match(self::$REGEX_YEAR, $this->output, $match);
            $this->year = (int)(array_key_exists(2, $match) ? $match[2] : 0);
        }

        return $this->year;
    }
967857
public function getBirthdate() : ?int 
    {
        if ( ! $this->hasBirthdate()) {
            $this->setBirthdate($this->getDefaultBirthdate());
        }
        return $this->birthdate;
    }
194630
public function getAge(): int
    {
        if (null !== $age = $this->getHeaderLine('Age')) {
            return (int) $age;
        }

        return \max(\time() - $this->getDate()->format('U'), 0);
    }
271147
public function monthLengthDays(int $month, int $year = null) : int
    {
        switch ($month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                return 31;
            case 4:
            case 6:
            case 9:
            case 11:
                return 30;
            case 2:
                return !date('L', $year === null ? $this->getTimestamp() : mktime(1, 1, 1, 2, 1, $year)) ? 28 : 29;
        }
        throw new \InvalidArgumentException('Arg month[' . $month . '] is not 1 through 12.');
    }
730674
def months_int(self):
        """"""
        if not self._is_reversed:
            return list(xrange(self.st_time.month, self.end_time.month + 1))
        else:
            months_st = list(xrange(self.st_time.month, 13))
            months_end = list(xrange(1, self.end_time.month + 1))
            return months_st + months_end
187353
static int getMonthLength(int month, int year) {
      Integer[] newMonths = getAdjustedMonthLength(year);
      return newMonths[month].intValue();
    }
939548
public static function getDaysByMonth($month, $year): int
    {
        $months = self::getDaysByMonthsOfYear($year);
        $value = $months [$month - 1];
        return !$value ? 0 : $value;
    }
1251480
public function getYears($limit = 90) {
        $years = array();
        $now_year = date('Y');
        for ($i = 0; $i < $limit; $i++) {
            $years[] = $now_year - $i;
        }
        return $years;
    }
1143449
protected function nextMonth(): array
    {
        if ($this->month === 6 && !$this->isLeapYear()) {
            return [
                $this->year,
                8,
            ];
        }

        return [
            $this->year + ($this->month === 13 ? 1 : 0),
            ($this->month % 13) + 1,
        ];
    }
474193
public static function rangeLastMonth()
    {
        $lastMonth = date('m') - 1;
        if ($lastMonth <= 0) {
            $lastMonth = 12;
        }
        $lastMonth = date('Y') . '-' . $lastMonth . '-01';

        return [self::toTs($lastMonth), self::toTs($lastMonth) + (86400 * (date('t', strtotime($lastMonth))-1))];
    }
31643
public function getDifferenceInMonths($compare = null)
        {
            if (!$compare) {
                $compare = new Date(null, $this->getTimezone());
            }

            $difference = $this->diff($compare);

            list($years, $months) = explode(':', $difference->format('%y:%m'), 2);

            return (($years * 12) + $months) * $difference->format('%r1');
        }