Sets day
@param int $day Day of the week, zero-indexed to Monday
@return $this
973108
public function setDay($day)
    {

        if (($day > 6)) {
            throw new \InvalidArgumentException('invalid value for $day when calling PutCorporationsCorporationIdStructuresStructureIdNewSchedule., must be smaller than or equal to 6.');
        }
        if (($day < 0)) {
            throw new \InvalidArgumentException('invalid value for $day when calling PutCorporationsCorporationIdStructuresStructureIdNewSchedule., must be bigger than or equal to 0.');
        }

        $this->container['day'] = $day;

        return $this;
    }
1134766
protected function setDate(array $date): Converter
    {
        $this->day = $date['day'];
        $this->month = $date['month'];
        $this->year = $date['year'];

        return $this;
    }
1111941
public function setDate($year, $month, $day)
    {
        if($this->_date->setDate($year, $month, $day) === false) {
            return false;
        }

        return $this;
    }
742502
private static function get(int $value) : DayOfWeek
    {
        static $values;

        if (! isset($values[$value])) {
            $values[$value] = new DayOfWeek($value);
        }

        return $values[$value];
    }
767306
public function setISODate($year, $week, $day = 1)
	{
		if ($this->datetime->setISODate($year, $week, $day))
		{
			return $this;
		}

		return false;
	}
354180
public function addWeekdays($value)
    {
        // Fix for weekday bug https://bugs.php.net/bug.php?id=54909
        $t = $this->toTimeString();
        $this->modify((int) $value.' weekday');

        return $this->setTimeFromTimeString($t);
    }
187849
public function weekly()
    {
        $this->setScheduleMonth(self::ANY);
        $this->setScheduleWeek(self::ANY);
        $this->setScheduleDayOfMonth(self::ANY);
        $this->setScheduleDayOfWeek(Day::SUNDAY);
        $this->setScheduleHour(0);
        $this->setScheduleMinute(0);

        return $this;
    }
413233
private function setDay($day) {
        
        //preventing duplication process
        if ($day == $this->day) {
            return;
        }
        $maximumDayOfMonth = static::getMonthLength($this->month, $this->year);
        $dayToSet          = $day;
        if ($dayToSet < 1) {
            
            $dayToSet = abs($dayToSet);
            
            while ($dayToSet > $maximumDayOfMonth) {
                $dayToSet -= $maximumDayOfMonth;
                $month    = $this->month - 1;
                $this->setMonth($month);
                $maximumDayOfMonth = static::getMonthLength($this->month, $this->year);
            }
            
            $dayToSet = $maximumDayOfMonth - $dayToSet;
            $month    = $this->month - 1;
            $this->setMonth($month);
            
        } elseif ($dayToSet > $maximumDayOfMonth) {
            while ($dayToSet > $maximumDayOfMonth) {
                $dayToSet -= $maximumDayOfMonth;
                $month    = $this->month + 1;
                $this->setMonth($month);
                $maximumDayOfMonth = static::getMonthLength($this->month, $this->year);
            }
        }
        
        $this->day = (int) $dayToSet;
    }
761497
public function setStartDate($date)
    {
        $date = AnDomainAttributeDate::getInstance()->setDate($date);
        $this->set('startDate', $date);

        return $this;
    }
415733
public function weekOfYear($week)
    {
        $this->setScheduleMonth(self::NONE);
        $this->setScheduleWeek($this->parseTimeParameter($week));
        $this->setScheduleDayOfMonth(self::ANY);
        $this->setScheduleDayOfWeek(Day::SUNDAY);
        $this->setScheduleHour(0);
        $this->setScheduleMinute(0);

        return $this;
    }
480659
public function forceWorkday($next = false)
	{
		$weekday = $this->format('N');
		if ($weekday == 7) $this->addDays(1);
		elseif ($weekday == 6) $next ? $this->addDays(2) : $this->addDays(-1);
		return $this;
	}
1297862
public function weeksAndDays($weeks, $days)
    {
        $this->dayz = ($weeks * ChronosInterface::DAYS_PER_WEEK) + $days;

        return $this;
    }
1013725
public static function setDay($ts = null, $day = 1)
	{
		list($H, $i, $s, $m, $d, $Y) = sfDateTimeToolkit::breakdown($ts);
		
		return mktime($H, $i, $s, $m, $day, $Y);
	}
152209
public function setDate($date) {
        $dateArray  =   getdate($date);
        $this->date         =   $dateArray[0];            //时间戳
        $this->second       =   $dateArray["seconds"];    //秒
        $this->minute       =   $dateArray["minutes"];    //分
        $this->hour         =   $dateArray["hours"];      //时
        $this->day          =   $dateArray["mday"];       //日
        $this->month        =   $dateArray["mon"];        //月
        $this->year         =   $dateArray["year"];       //年

        $this->weekday      =   $dateArray["wday"];       //星期 0～6
        $this->cWeekday     =   '星期'.$this->Week[$this->weekday];//$dateArray["weekday"];    //星期完整表示
        $this->yDay         =   $dateArray["yday"];       //一年中的天数 0－365
        $this->cMonth       =   $dateArray["month"];      //月份的完整表示

        $this->CDATE        =   $this->format("%Y-%m-%d");//日期表示
        $this->YMD          =   $this->format("%Y%m%d");  //简单日期
        $this->CTIME        =   $this->format("%H:%M:%S");//时间表示

        return ;
    }
287915
function setMDY( $month, $day = 0, $year = 0 )
    {
        if ( $year != 0 )
            $date = mktime( 0, 0, 0, $month, $day, $year );
        else if ( $day != 0 )
            $date = mktime( 0, 0, 0, $month, $day );
        else
            $date = mktime( 0, 0, 0, $month );
        $this->Date = $date;
    }
496613
public function setToday(): self
	{
		return $this->modifyClone()->setDate((int) date('Y'), (int) date('m'), (int) date('d'));
	}
1212560
public function dayTo(int $day): Date
    {
        return $this->createNewDateWithExistingTime(
                $this->originalDate->year(),
                $this->originalDate->month(),
                $day
        );
    }