src/Date.php
public static function parse($time = null, $timezone = null)
    {
        if ($time instanceof Carbon) {
            return new static(
                $time->toDateTimeString(),
                $timezone ?: $time->getTimezone()
            );
        }

        if (!is_int($time)) {
            $time = static::translateTimeString($time);
        }

        return new static($time, $timezone);
    }
public static function parse($time = null, $timezone = null)
    {
        if ($time instanceof Carbon) {
            return new static(
                $time->toDateTimeString(),
                $timezone ?: $time->getTimezone()
            );
        }

        if (!is_int($time)) {
            $time = static::translateTimeString($time);
        }

        return new static($time, $timezone);
    }
public static function parse ( $ time = null , $ timezone = null ) { if ( $ time instanceof Carbon ) { return new static ( $ time -> toDateTimeString ( ) , $ timezone ? : $ time -> getTimezone ( ) ) ; } if ( ! is_int ( $ time ) ) { $ time = static :: translateTimeString ( $ time ) ; } return new static ( $ time , $ timezone ) ; }
Create a Date instance from a string.

@param  string $time
@param  string|DateTimeZone $timezone
@return Date
Create a Date instance from a string .