protected function stripTime($time)
    {
        if (is_int($time) || ctype_digit($time)) {
            return gmdate('Y-m-d 00:00:00', $time);
        }
        if ($time instanceof DateTimeInterface) {
            $time = $time->format('Y-m-d 00:00:00');
        }
        if (substr($time, 0, 1) === '@') {
            return gmdate('Y-m-d 00:00:00', substr($time, 1));
        }
        if ($time === null || $time === 'now' || $time === '') {
            return date('Y-m-d 00:00:00');
        }
        if ($this->hasRelativeKeywords($time)) {
            return date('Y-m-d 00:00:00', strtotime($time));
        }

        return preg_replace('/\d{1,2}:\d{1,2}:\d{1,2}(?:\.\d+)?/', '00:00:00', $time);
    }
protected function stripTime($time)
    {
        if (is_int($time) || ctype_digit($time)) {
            return gmdate('Y-m-d 00:00:00', $time);
        }
        if ($time instanceof DateTimeInterface) {
            $time = $time->format('Y-m-d 00:00:00');
        }
        if (substr($time, 0, 1) === '@') {
            return gmdate('Y-m-d 00:00:00', substr($time, 1));
        }
        if ($time === null || $time === 'now' || $time === '') {
            return date('Y-m-d 00:00:00');
        }
        if ($this->hasRelativeKeywords($time)) {
            return date('Y-m-d 00:00:00', strtotime($time));
        }

        return preg_replace('/\d{1,2}:\d{1,2}:\d{1,2}(?:\.\d+)?/', '00:00:00', $time);
    }
protected function stripTime ( $ time ) { if ( is_int ( $ time ) || ctype_digit ( $ time ) ) { return gmdate ( 'Y-m-d 00:00:00' , $ time ) ; } if ( $ time instanceof DateTimeInterface ) { $ time = $ time -> format ( 'Y-m-d 00:00:00' ) ; } if ( substr ( $ time , 0 , 1 ) === '@' ) { return gmdate ( 'Y-m-d 00:00:00' , substr ( $ time , 1 ) ) ; } if ( $ time === null || $ time === 'now' || $ time === '' ) { return date ( 'Y-m-d 00:00:00' ) ; } if ( $ this -> hasRelativeKeywords ( $ time ) ) { return date ( 'Y-m-d 00:00:00' , strtotime ( $ time ) ) ; } return preg_replace ( '/\d{1,2}:\d{1,2}:\d{1,2}(?:\.\d+)?/' , '00:00:00' , $ time ) ; }
Removes the time components from an input string.

Used to ensure constructed objects always lack time.

@param string|int $time The input time. Integer values will be assumed
to be in UTC. The 'now' and '' values will use the current local time.
@return string The date component of $time.
Removes the time components from an input string .