src/LocalDateTime.php
public static function parse(string $text, DateTimeParser $parser = null) : LocalDateTime
    {
        if (! $parser) {
            $parser = IsoParsers::localDateTime();
        }

        return LocalDateTime::from($parser->parse($text));
    }
public static function parse(string $text, DateTimeParser $parser = null) : LocalDateTime
    {
        if (! $parser) {
            $parser = IsoParsers::localDateTime();
        }

        return LocalDateTime::from($parser->parse($text));
    }
public static function parse ( string $ text , DateTimeParser $ parser = null ) : LocalDateTime { if ( ! $ parser ) { $ parser = IsoParsers :: localDateTime ( ) ; } return LocalDateTime :: from ( $ parser -> parse ( $ text ) ) ; }
Obtains an instance of `LocalDateTime` from a text string.

@param string              $text   The text to parse, such as `2007-12-03T10:15:30`.
@param DateTimeParser|null $parser The parser to use, defaults to the ISO 8601 parser.

@return LocalDateTime

@throws DateTimeException      If the date-time is not valid.
@throws DateTimeParseException If the text string does not follow the expected format.
Obtains an instance of LocalDateTime from a text string .