public function formatTimepoint($time, $format)
    {
        if ($time instanceof TimePoint) {
            return $time->format($format, $this->displayTimezone);
        }

        if ($time instanceof DateTime) {
            $formatted = clone $time;
            $formatted->setTimezone(new DateTimeZone($this->displayTimezone));
            return $formatted->format($format);
        }

        return '';
    }
public function formatTimepoint($time, $format)
    {
        if ($time instanceof TimePoint) {
            return $time->format($format, $this->displayTimezone);
        }

        if ($time instanceof DateTime) {
            $formatted = clone $time;
            $formatted->setTimezone(new DateTimeZone($this->displayTimezone));
            return $formatted->format($format);
        }

        return '';
    }
public function formatTimepoint ( $ time , $ format ) { if ( $ time instanceof TimePoint ) { return $ time -> format ( $ format , $ this -> displayTimezone ) ; } if ( $ time instanceof DateTime ) { $ formatted = clone $ time ; $ formatted -> setTimezone ( new DateTimeZone ( $ this -> displayTimezone ) ) ; return $ formatted -> format ( $ format ) ; } return '' ; }
Format a DateTime or TimePoint. Invalid values will output an empty string.

@param TimePoint|DateTime|null $time
@param string $format

@return string
Format a DateTime or TimePoint . Invalid values will output an empty string .