src/Parser/DateTimeParseResult.php
public function getField(string $name) : string
    {
        $value = $this->getOptionalField($name);

        if ($value === '') {
            throw new DateTimeParseException(\sprintf('Field %s is not present in the parsed result.', $name));
        }

        return $value;
    }
public function getField(string $name) : string
    {
        $value = $this->getOptionalField($name);

        if ($value === '') {
            throw new DateTimeParseException(\sprintf('Field %s is not present in the parsed result.', $name));
        }

        return $value;
    }
public function getField ( string $ name ) : string { $ value = $ this -> getOptionalField ( $ name ) ; if ( $ value === '' ) { throw new DateTimeParseException ( \ sprintf ( 'Field %s is not present in the parsed result.' , $ name ) ) ; } return $ value ; }
Returns the first value parsed for the given field.

@param string $name One of the field constants.

@return string The value for this field.

@throws DateTimeParseException If the field is not present in this set.
Returns the first value parsed for the given field .