src/Carbon/CarbonPeriod.php
public function rewind()
    {
        $this->key = 0;
        $this->current = call_user_func([$this->dateClass, 'make'], $this->startDate);
        $settings = $this->getSettings();
        $locale = $this->getLocalTranslator()->getLocale();
        if ($locale) {
            $settings['locale'] = $locale;
        }
        $this->current->settings($settings);
        $this->timezone = static::intervalHasTime($this->dateInterval) ? $this->current->getTimezone() : null;

        if ($this->timezone) {
            $this->current = $this->current->utc();
        }

        $this->validationResult = null;

        if ($this->isStartExcluded() || $this->validateCurrentDate() === false) {
            $this->incrementCurrentDateUntilValid();
        }
    }
public function rewind()
    {
        $this->key = 0;
        $this->current = call_user_func([$this->dateClass, 'make'], $this->startDate);
        $settings = $this->getSettings();
        $locale = $this->getLocalTranslator()->getLocale();
        if ($locale) {
            $settings['locale'] = $locale;
        }
        $this->current->settings($settings);
        $this->timezone = static::intervalHasTime($this->dateInterval) ? $this->current->getTimezone() : null;

        if ($this->timezone) {
            $this->current = $this->current->utc();
        }

        $this->validationResult = null;

        if ($this->isStartExcluded() || $this->validateCurrentDate() === false) {
            $this->incrementCurrentDateUntilValid();
        }
    }
public function rewind ( ) { $ this -> key = 0 ; $ this -> current = call_user_func ( [ $ this -> dateClass , 'make' ] , $ this -> startDate ) ; $ settings = $ this -> getSettings ( ) ; $ locale = $ this -> getLocalTranslator ( ) -> getLocale ( ) ; if ( $ locale ) { $ settings [ 'locale' ] = $ locale ; } $ this -> current -> settings ( $ settings ) ; $ this -> timezone = static :: intervalHasTime ( $ this -> dateInterval ) ? $ this -> current -> getTimezone ( ) : null ; if ( $ this -> timezone ) { $ this -> current = $ this -> current -> utc ( ) ; } $ this -> validationResult = null ; if ( $ this -> isStartExcluded ( ) || $ this -> validateCurrentDate ( ) === false ) { $ this -> incrementCurrentDateUntilValid ( ) ; } }
Rewind to the start date.

Iterating over a date in the UTC timezone avoids bug during backward DST change.

@see https://bugs.php.net/bug.php?id=72255
@see https://bugs.php.net/bug.php?id=74274
@see https://wiki.php.net/rfc/datetime_and_daylight_saving_time

@throws \RuntimeException

@return void
Rewind to the start date .