public static function createFromFormat($format, $time, $timezone = null)
    {
        if (null === $timezone) {
            $parent = parent::createFromFormat($format, $time);
        } else {
            $parent = parent::createFromFormat($format, $time, $timezone);
        }

        if (false === $parent instanceof DateTime) {
            return false;
        }

        if (null === $timezone) {
            return new static($parent->format('Y-m-d H:i:s.u'));
        } else {
            return new static($parent->format('Y-m-d H:i:s.u'), $timezone);
        }
    }
public static function createFromFormat($format, $time, $timezone = null)
    {
        if (null === $timezone) {
            $parent = parent::createFromFormat($format, $time);
        } else {
            $parent = parent::createFromFormat($format, $time, $timezone);
        }

        if (false === $parent instanceof DateTime) {
            return false;
        }

        if (null === $timezone) {
            return new static($parent->format('Y-m-d H:i:s.u'));
        } else {
            return new static($parent->format('Y-m-d H:i:s.u'), $timezone);
        }
    }
public static function createFromFormat ( $ format , $ time , $ timezone = null ) { if ( null === $ timezone ) { $ parent = parent :: createFromFormat ( $ format , $ time ) ; } else { $ parent = parent :: createFromFormat ( $ format , $ time , $ timezone ) ; } if ( false === $ parent instanceof DateTime ) { return false ; } if ( null === $ timezone ) { return new static ( $ parent -> format ( 'Y-m-d H:i:s.u' ) ) ; } else { return new static ( $ parent -> format ( 'Y-m-d H:i:s.u' ) , $ timezone ) ; } }
Returns new DateTimeImmutable object formatted according to the specified format.

@link http://php.net/manual/en/datetimeimmutable.createfromformat.php

@param string            $format
@param string            $time
@param DateTimeZone|null $timezone

@return DateTimeImmutable|false
Returns new DateTimeImmutable object formatted according to the specified format .