计算日期加天数后的日期

@param string $date :如 "2005-10-20"
@param int $day  :如 6
@return string
196676
public static function dateAddDay($date, $day)
    {
        $daystr = "+$day day";
        $dateday = date("Y-m-d", strtotime($daystr, strtotime($date)));
        return $dateday;
    }
709889
protected function valueToDateTime($date)
    {
        if (!$date instanceof \DateTime) {
            $date = is_int($date) ? \DateTime::createFromFormat('U', $date) : new \DateTime((string)$date);
        }
        
        return $date;
    }
946131
public static function shortDate($date)
    {
        if (self::isDate($date)) {
            $str = self::dateTimeToTimeStamp($date);
            $string = date("d.m.Y", $str);
            return $string;
        } else {
            return null;
        }
    }
865552
public static function dayStringToNumber($day)
    {
        $strippedDayValue = (str_replace(self::$numberSuffixes, '', $day));
        if (is_numeric($strippedDayValue)) {
            return (integer) $strippedDayValue;
        }
        return $day;
    }
1106021
public static function subDays($date, $days)
    {
        $d = self::formatDate($date);
        $d = date_parse($d);
        $d = mktime($d['hour'], $d['minute'], $d['second'], $d['month'], $d['day'] - $days, $d['year']);
        return self::formatDate($d);
    }
380021
public function date($date)
    {
        if (! $date instanceof DateTime) {
            $date = new DateTime($date);
        }

        $this->executionYear = $date->format('Y');

        return $this->at("{$date->format('i')} {$date->format('H')} {$date->format('d')} {$date->format('m')} *");
    }
479644
public function getDayOfWeek(AnDate $date = null)
    {
        $year = isset($date) ? $date->year  : $this->year;
        $month = isset($date) ? $date->month : $this->month;
        $day = isset($date) ? $date->day   : $this->day;

        if ($month > 2) {
            $month -= 2;
        } else {
            $month += 10;
            $year--;
        }

        $day = (floor((13 * $month - 1) / 5) +
                $day + ($year % 100) +
                floor(($year % 100) / 4) +
                floor(($year / 100) / 4) - 2 *
                floor($year / 100) + 77);

        $weekday_number = $day - 7 * floor($day / 7);
        return $weekday_number;
    }
323899
public function getDate($date = null, $format = 'Y-m-d H:i:s')
    {
        if (strlen($date) < 0) {
            $date = date('d-m-Y H:i:s');
        }

        $timeStamp = new DateTime($date);
        return $timeStamp->format($format);
    }
200023
public function seeDateIsTuesday($date) {
        \PHPUnit_Framework_Assert::assertTrue($this->_ParseDate($date)->dayOfWeek == Carbon::TUESDAY);
    }
203428
public static function convertDate($date)
    {
        if (\is_int($date)) {
            $timestamp = $date;
        } else {
            $timestamp = \strtotime($date);
        }
        $string = \date('Y-m-d\TH:i:s\Z', $timestamp);

        return $string;
    }
1338813
private static function cast(Date $date = null)
	{
		if (!is_null($date))
		{
			$date = new DateTime($date);
		}

		return $date;
	}
551917
public function dateFormat($date, string $format = 'M d Y'): string
    {
        if ($date instanceof DateTime) {
            return $date->format($format);
        } elseif (is_int($date)) {
            return date($format, $date);
        }

        return date($format, strtotime($date));
    }
833682
public function setDateFrom($date = null)
    {
        $date = $this->resolveCarbon($date);

        return $this->setDate($date->year, $date->month, $date->day);
    }
762189
public static function date($date){

		$Date = static::_utcZeroDateTime($date);

		if($Date === null){

			return $date;
		}

		return $Date->format('Y-m-d');
	}
369669
private function parseDate($date): AbstractCalendarDate
    {
        // Valid calendar escape specified? - use it
        if (preg_match('/^(@#D(?:GREGORIAN|JULIAN|HEBREW|HIJRI|JALALI|FRENCH R|ROMAN)+@) ?(.*)/', $date, $match)) {
            $cal  = $match[1];
            $date = $match[2];
        } else {
            $cal = '';
        }
        // A date with a month: DM, M, MY or DMY
        if (preg_match('/^(\d?\d?) ?(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC|TSH|CSH|KSL|TVT|SHV|ADR|ADS|NSN|IYR|SVN|TMZ|AAV|ELL|VEND|BRUM|FRIM|NIVO|PLUV|VENT|GERM|FLOR|PRAI|MESS|THER|FRUC|COMP|MUHAR|SAFAR|RABI[AT]|JUMA[AT]|RAJAB|SHAAB|RAMAD|SHAWW|DHUAQ|DHUAH|FARVA|ORDIB|KHORD|TIR|MORDA|SHAHR|MEHR|ABAN|AZAR|DEY|BAHMA|ESFAN) ?((?:\d{1,4}(?: B\.C\.)?|\d\d\d\d\/\d\d)?)$/', $date, $match)) {
            $d = $match[1];
            $m = $match[2];
            $y = $match[3];
        } elseif (preg_match('/^(\d{1,4}(?: B\.C\.)?|\d\d\d\d\/\d\d)$/', $date, $match)) {
            // A date with just a year
            $d = '';
            $m = '';
            $y = $match[1];
        } else {
            // An invalid date - do the best we can.
            $d = '';
            $m = '';
            $y = '';
            // Look for a 3/4 digit year anywhere in the date
            if (preg_match('/\b(\d{3,4})\b/', $date, $match)) {
                $y = $match[1];
            }
            // Look for a month anywhere in the date
            if (preg_match('/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC|TSH|CSH|KSL|TVT|SHV|ADR|ADS|NSN|IYR|SVN|TMZ|AAV|ELL|VEND|BRUM|FRIM|NIVO|PLUV|VENT|GERM|FLOR|PRAI|MESS|THER|FRUC|COMP|MUHAR|SAFAR|RABI[AT]|JUMA[AT]|RAJAB|SHAAB|RAMAD|SHAWW|DHUAQ|DHUAH|FARVA|ORDIB|KHORD|TIR|MORDA|SHAHR|MEHR|ABAN|AZAR|DEY|BAHMA|ESFAN)/', $date, $match)) {
                $m = $match[1];
                // Look for a day number anywhere in the date
                if (preg_match('/\b(\d\d?)\b/', $date, $match)) {
                    $d = $match[1];
                }
            }
        }

        // Unambiguous dates - override calendar escape
        if (preg_match('/^(TSH|CSH|KSL|TVT|SHV|ADR|ADS|NSN|IYR|SVN|TMZ|AAV|ELL)$/', $m)) {
            $cal = JewishDate::ESCAPE;
        } elseif (preg_match('/^(VEND|BRUM|FRIM|NIVO|PLUV|VENT|GERM|FLOR|PRAI|MESS|THER|FRUC|COMP)$/', $m)) {
            $cal = FrenchDate::ESCAPE;
        } elseif (preg_match('/^(MUHAR|SAFAR|RABI[AT]|JUMA[AT]|RAJAB|SHAAB|RAMAD|SHAWW|DHUAQ|DHUAH)$/', $m)) {
            $cal = HijriDate::ESCAPE; // This is a WT extension
        } elseif (preg_match('/^(FARVA|ORDIB|KHORD|TIR|MORDA|SHAHR|MEHR|ABAN|AZAR|DEY|BAHMA|ESFAN)$/', $m)) {
            $cal = JalaliDate::ESCAPE; // This is a WT extension
        } elseif (preg_match('/^\d{1,4}( B\.C\.)|\d\d\d\d\/\d\d$/', $y)) {
            $cal = JulianDate::ESCAPE;
        }

        // Ambiguous dates - don't override calendar escape
        if ($cal === '') {
            if (preg_match('/^(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)$/', $m)) {
                $cal =  GregorianDate::ESCAPE;
            } elseif (preg_match('/^[345]\d\d\d$/', $y)) {
                // Year 3000-5999
                $cal = JewishDate::ESCAPE;
            } else {
                $cal = GregorianDate::ESCAPE;
            }
        }
        // Now construct an object of the correct type
        switch ($cal) {
            case GregorianDate::ESCAPE:
                return new GregorianDate([
                    $y,
                    $m,
                    $d,
                ]);
            case JulianDate::ESCAPE:
                return new JulianDate([
                    $y,
                    $m,
                    $d,
                ]);
            case JewishDate::ESCAPE:
                return new JewishDate([
                    $y,
                    $m,
                    $d,
                ]);
            case HijriDate::ESCAPE:
                return new HijriDate([
                    $y,
                    $m,
                    $d,
                ]);
            case FrenchDate::ESCAPE:
                return new FrenchDate([
                    $y,
                    $m,
                    $d,
                ]);
            case JalaliDate::ESCAPE:
                return new JalaliDate([
                    $y,
                    $m,
                    $d,
                ]);
            case RomanDate::ESCAPE:
                return new RomanDate([
                    $y,
                    $m,
                    $d,
                ]);
            default:
                throw new DomainException('Invalid calendar');
        }
    }
1287265
public function date_asctime($date)
	{
		static $pcre;
		if (!$pcre)
		{
			$space = '[\x09\x20]+';
			$wday_name = $this->day_pcre;
			$mon_name = $this->month_pcre;
			$day = '([0-9]{1,2})';
			$hour = $sec = $min = '([0-9]{2})';
			$year = '([0-9]{4})';
			$terminator = '\x0A?\x00?';
			$pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i';
		}
		if (preg_match($pcre, $date, $match))
		{
			/*
			Capturing subpatterns:
			1: Day name
			2: Month
			3: Day
			4: Hour
			5: Minute
			6: Second
			7: Year
			*/

			$month = $this->month[strtolower($match[2])];
			return gmmktime($match[4], $match[5], $match[6], $month, $match[3], $match[7]);
		}

		return false;
	}
175494
public static Date getDayDate(Date date) {
		Calendar calendar = getCalendar();
		calendar.setTime(date);
		return getDayDate(calendar);
	}