Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00

@return static
968924
public function startOfWeek()
    {
        $dt = $this;
        if ($dt->dayOfWeek !== static::$weekStartsAt) {
            $dt = $dt->previous(static::$weekStartsAt);
        }

        return $dt->startOfDay();
    }
1257939
function createDuration() {
    if( !isset( $this->duration['value']['week'] ) &&
        !isset( $this->duration['value']['day'] )  &&
        !isset( $this->duration['value']['hour'] ) &&
        !isset( $this->duration['value']['min'] )  &&
        !isset( $this->duration['value']['sec'] ))
      return;
    $attributes = $this->_createParams( $this->duration['params'] );
    return $this->_createElement( 'DURATION', $attributes, $this->_format_duration( $this->duration['value'] ));
  }
749696
public function weeks($startDay = 'Monday')
    {
        if (!isset($this->weeks[$startDay])) {
            $this->weeks[$startDay] = array();
            $keepWeeking = true;
            $weekPoint = clone $this->firstDay();

            while ($keepWeeking) {
                $candidateWeek = new Week($weekPoint, $startDay);
                if ($candidateWeek->weekStart() <= $this->lastDay()) {
                    $candidateWeek->setContainingMonth($this);
                    $this->weeks[$startDay][] = $candidateWeek;
                    $weekPoint->modify('+1 week');
                } else {
                    $keepWeeking = false;
                }
            }
        }
        return $this->weeks[$startDay];
    }
15312
public static function firstDayOfQuarter($ts = null)
	{
		// default to now
		if ($ts === null) $ts = sfDateTimeToolkit::now();
		
		// variables for computation
		$month = date('m', $ts);
		$quarter = ceil($month / 3) - 1; // zero based quarter
		
		return sfTime::subtractMonth(sfTime::firstDayOfMonth($ts), $month - ($quarter * 3) - 1);
	}
352515
public function setStart($start)
    {
        Argument::i()->test(1, 'int');
        
        if ($start < 0) {
            $start = 0;
        }
        
        $this->start = $start;
        
        return $this;
    }
112706
public function reset()
    {
        $this->_data     = array();
        $this->_modified = array();

        if ($this->isConnected()) {
            $this->_data = $this->getTable()->getDefaults();
        }

        return $this;
    }
707666
public function reset()
    {
        $this->arguments = [];
        $this->section = '';
        $this->format = null;
        $this->createAbsoluteUri = false;
        $this->addQueryString = false;
        $this->argumentsToBeExcludedFromQueryString = [];

        return $this;
    }
16621
public function setCurrentTime(): self
	{
		return $this->modifyClone()->setTime((int) date('H'), (int) date('i'), (int) date('s'));
	}
429522
public function getStartDate() : ?string 
    {
        if ( ! $this->hasStartDate()) {
            $this->setStartDate($this->getDefaultStartDate());
        }
        return $this->startDate;
    }
480552
public function getStart(): ?\DateTimeInterface
    {
        $lowest_date = null;
        foreach ($this->events as $event) {
            if (null === $lowest_date || $event->getStart() < $lowest_date) {
                $lowest_date = $event->getStart();
            }
        }

        return $lowest_date;
    }
1142425
public function thisWeek()
    {
        $scheduleWeek = $this->scheduler->getScheduleWeek();
        $currentWeek = $this->now->format('W');

        //if a month is defined, week refers to the week of the month
        $scheduleMonth = $this->scheduler->getScheduleMonth();
        if (!is_null($scheduleMonth) && $scheduleMonth !== Scheduler::NONE) {
            return $this->isCurrent($scheduleWeek, $this->now->weekOfMonth);
        }

        //if it's an odd or even week
        if ($scheduleWeek == 'odd' && $currentWeek & 1) {
            return true;
        } elseif ($scheduleWeek == 'even' && !($currentWeek & 1)) {
            return true;
        }

        return $this->isCurrent($scheduleWeek, $this->now->weekOfYear);
    }
61478
def locale_first_weekday():
    """"""
    first_weekday = 6 #by default settle on monday

    try:
        process = os.popen("locale first_weekday week-1stday")
        week_offset, week_start = process.read().split('\n')[:2]
        process.close()
        week_start = dt.date(*time.strptime(week_start, "%Y%m%d")[:3])
        week_offset = dt.timedelta(int(week_offset) - 1)
        beginning = week_start + week_offset
        first_weekday = int(beginning.strftime("%w"))
    except:
        logger.warn("WARNING - Failed to get first weekday from locale")

    return first_weekday
676037
public function setStartDay($daysBack)
    {
        if (!is_null($daysBack)) {
            $this->addStatusMessage('Start Date '.date('Y-m-d',
                    mktime(0, 0, 0, date("m"), date("d") - $daysBack, date("Y"))));
        }
        $this->daysBack = $daysBack;
    }
1342448
public function reset()
    {
        $this->start = null;
        $this->range = null;
        $this->sort = null;
        $this->sortDirection = null;
        $this->search = null;
        $this->searchNotes = null;
        $this->condition = null;
        return $this;
    }
427023
public function reset(): Matomo
    {
        $this->_period = self::PERIOD_DAY;
        $this->_date = '';
        $this->_rangeStart = 'yesterday';
        $this->_rangeEnd = null;

        return $this;
    }
1346810
public function reset()
    {
        $this->statement = null;
        $this->params = array();
        $this->positionParams = array();
        $this->query = array();
        $this->sql = null;

        return $this;
    }
1373059
public function startOfWeek()
        {
            if ($this->dayOfWeek != self::MONDAY) $this->previous(self::MONDAY);

            return $this->startOfDay();
        }