Statystyki do dnia (wraz z poprzednim miesiącem
@param string $object
@param integer $objectId
@param integer $year
@param string $month
@param string $day
@return string
961273
public static function toDate($object, $objectId, $year, $month, $day)
    {
        $now = strtotime($year . '-' . $month . '-' . $day);
        $prev = strtotime('-1 month', $now);

        $raw = [];
        //uzupełnianie danych surowych poprzednim miesiącem
        foreach (self::getRows($object, $objectId, date('Y', $prev), date('m', $prev), true, null) as $stat) {
            $raw[$stat->year . '-' . $stat->month . '-' . $stat->day] = $stat->count;
        }
        //uzupełnianie danych surowych obecnym miesiącem
        foreach (self::getRows($object, $objectId, date('Y', $now), date('m', $now), true, null) as $stat) {
            $raw[$stat->year . '-' . $stat->month . '-' . $stat->day] = $stat->count;
        }
        $statArray = [];

        //uzupełnianie dni
        for ($i = 30; $i > -1; $i--) {
            $curTime = strtotime('-' . $i . ' day', $now);
            $count = 0;
            if (isset($raw[date('Y', $curTime) . '-' . ltrim(date('m', $curTime), '0') . '-' . ltrim(date('d', $curTime), '0')])) {
                $count = $raw[date('Y', $curTime) . '-' . ltrim(date('m', $curTime), '0') . '-' . ltrim(date('d', $curTime), '0')];
            }
            $statArray[date('m.d', $curTime)] = $count;
        }
        return $statArray;
    }
490252
public function month(int $vehicleId, int $year, int $month = 1, ?Query $query = null): Response
    {
        $this->requiresAccessToken();

        return $this->send(
            'GET',
            "vehicles/{$vehicleId}/checkpoints/{$year}/{$month}",
            $this->getApiHeaders(),
            $this->buildHttpQuery($query)
        );
    }
45643
public function retrieveDay($day, $month = null) {
		$day = (int)$day;
		if ($day < 1 || $day > 31) {
			return 0;
		}

		// TODO check on month days!

		return $day;
	}
579310
public static function imagesByObject($object = null, $objectId = null)
    {
        //zapytanie po obiekcie
        return self::byObject($object, $objectId)
                ->whereClass()->equals('image');
    }
208867
function(year, month, day) {
    var date = new Date(Date.UTC(year, month - 1, day));
    return date;
  }
1009541
public static function checkBirthDate($day, $month, $year) {
        if (empty($day) || empty($month) || empty($year))
            return false;

        return checkdate($month, $day, $year);
    }
1134654
public function archiveMonthlyAction($year, $month, Request $request = null)
    {
        $action = $this->container->get(MonthlyPostArchiveAction::class);

        return $action($this->resolveRequest($request), $year, $month);
    }
119486
public static function monthly($object, $objectId, $year)
    {
        $statArray = [];
        //pobieranie rekordów
        foreach (self::getRows($object, $objectId, $year, true, null, null) as $stat) {
            $stat->month = str_pad($stat->month, 2, '0', STR_PAD_LEFT);
            $statArray[$stat->year . '-' . $stat->month] = $stat->count;
        }
        $stats = [];
        //dodawanie do kubełków miesięcy
        for ($i = 1; $i <= 12; $i++) {
            $month = str_pad($i, 2, '0', STR_PAD_LEFT);
            $count = 0;
            if (isset($statArray[$year . '-' . $month])) {
                $count = $statArray[$year . '-' . $month];
            }
            $stats[$year . '-' . $month] = $count;
        }
        return $stats;
    }
796122
public static function gregorianToJulian(int $year, int $month, int $day)
    {
        if ($month < 3)
        {
            $year -= 1;
            $month += 12;
        }

        $a = floor($year / 100.0);
        $b = ($year === 1582 && ($month > 10 || ($month === 10 && $day > 4)) ? -10 :
            ($year === 1582 && $month === 10 ? 0 :
                ($year < 1583 ? 0 : 2 - $a + floor($a / 4.0))));

        return floor(365.25 * ($year + 4716)) + floor(30.6001 * ($month + 1)) + $day + $b - 1524;
    }
604717
public static function createJalaliDate($year = null, $month = null, $day = null, $timezone = null)
    {
        return static::createJalali($year, $month, $day, null, null, null, $timezone);
    }
1194834
protected static function checkDate($day, $month, $year)
    {
        // Tolerate both day-month and month-day order
        if ((12 <= $month && $month <= 31) && $day <= 12) {
            $m = $month;
            $month = $day;
            $day = $m;
        }
        if ($day > 31 || $month > 12) {
            return false;
        }
        if (!(1900 <= $year && $year <= 2019)) {
            return false;
        }

        return [$day, $month, $year];
    }
939548
public static function getDaysByMonth($month, $year): int
    {
        $months = self::getDaysByMonthsOfYear($year);
        $value = $months [$month - 1];
        return !$value ? 0 : $value;
    }
1111941
public function setDate($year, $month, $day)
    {
        if($this->_date->setDate($year, $month, $day) === false) {
            return false;
        }

        return $this;
    }
201161
public static function firstDayOfMonth($month = null, $year = null, $format = 'Y-m-d')
    {
        $year = $year ? $year : date('Y');
        $month = $month ? $month : date('m');
        return date($format, mktime(0, 0, 0, $month, 1, $year));
    }
904107
public static String toDisplayString(final Calendar date, final String year, final String month, final String day) {
		return format(date, "yyyy") + year + format(date, "MM") + month + format(date, "dd") + day;
	}
21378
public static function get_calendar_day_view($year, $month, $day, $courseid, $categoryid) {
        global $DB, $USER, $PAGE;

        // Parameter validation.
        $params = self::validate_parameters(self::get_calendar_day_view_parameters(), [
            'year' => $year,
            'month' => $month,
            'day' => $day,
            'courseid' => $courseid,
            'categoryid' => $categoryid,
        ]);

        $context = \context_user::instance($USER->id);
        self::validate_context($context);

        $type = \core_calendar\type_factory::get_calendar_instance();

        $time = $type->convert_to_timestamp($params['year'], $params['month'], $params['day']);
        $calendar = \calendar_information::create($time, $params['courseid'], $params['categoryid']);
        self::validate_context($calendar->context);

        list($data, $template) = calendar_get_view($calendar, 'day');

        return $data;
    }
1109594
function lastday ($month,$day,$year)

	{

		$lastdayen=date("d",mktime(0,0,0,$month+1,0,$year));

		list( $jyear, $jmonth, $jday ) = $this->gregorian_to_jalali($year, $month, $day);

		$lastdatep=$jday;

		$jday=$jday2;

		while($jday2!="1")

		{

			if($day<$lastdayen)

			{

				$day++;

				list( $jyear, $jmonth, $jday2 ) = $this->gregorian_to_jalali($year, $month, $day);

				if($pdate2=="1") break;

				if($pdate2!="1") $lastdatep++;

			}

			else

			{

				$day=0;

				$month++;

				if($month==13)

				{

					$month="1";

					$year++;

				}

			}



		}

		return $lastdatep-1;

	}