public function format(string $format) : string
    {
        // Replace microseconds first so they become literals.
        // Ignore any escaped microsecond identifiers.
        $format = preg_replace_callback(
            // Starting at the start of the string or the first non % character,
            // consume pairs of % characters (effectively consuming all escaped %s)
            // and finally match the string %u.
            '/((?:^|[^%])(?:%{2})*)(%u)/',
            function (array $matches) {
                return $matches[1] . $this->microseconds;
            },
            $format
        );

        $format = $this->wrapped->format($format);
        
        return $format;
    }
public function format(string $format) : string
    {
        // Replace microseconds first so they become literals.
        // Ignore any escaped microsecond identifiers.
        $format = preg_replace_callback(
            // Starting at the start of the string or the first non % character,
            // consume pairs of % characters (effectively consuming all escaped %s)
            // and finally match the string %u.
            '/((?:^|[^%])(?:%{2})*)(%u)/',
            function (array $matches) {
                return $matches[1] . $this->microseconds;
            },
            $format
        );

        $format = $this->wrapped->format($format);
        
        return $format;
    }
public function format ( string $ format ) : string { // Replace microseconds first so they become literals. // Ignore any escaped microsecond identifiers. $ format = preg_replace_callback ( // Starting at the start of the string or the first non % character, // consume pairs of % characters (effectively consuming all escaped %s) // and finally match the string %u. '/((?:^|[^%])(?:%{2})*)(%u)/' , function ( array $ matches ) { return $ matches [ 1 ] . $ this -> microseconds ; } , $ format ) ; $ format = $ this -> wrapped -> format ( $ format ) ; return $ format ; }
In addition to the regular \DateInterval formats, this also supports %u for microseconds.

@param string $format

@return string
In addition to the regular \ DateInterval formats this also supports %u for microseconds .