IntlDateFormatter::setLenient()

bool setLenient(bool $lenient)

Set the leniency of the parser.

Define if the parser is strict or lenient in interpreting inputs that do not match the pattern exactly. Enabling lenient parsing allows the parser to accept otherwise flawed date or time patterns, parsing as much as possible to obtain a value. Extra space, unrecognized tokens, or invalid values ("February 30th") are not accepted.

Parameters

bool $lenient Sets whether the parser is lenient or not. Currently only false (strict) is supported.

Return Value

bool true on success or false on failure

Exceptions

MethodArgumentValueNotImplementedException When $lenient is true

See also

http://www.php.net/manual/en/intldateformatter.setlenient.php
doc_Symfony
2016-10-28 06:21:39
Comments
Leave a Comment

Please login to continue.