parseLocalDateQuiet
parseLocalDateQuiet
parses the string argument as a local date, which is a date without a time or time zone.
Date-strings are formatted according to the ISO 8601 date time format as YYYY-MM-DD.
"Quiet" methods return null
instead of throwing an exception when encountering a string that cannot be parsed.
Syntax
parseLocalDateQuiet(s)
Parameters
Parameter | Type | Description |
---|---|---|
s | string | The string to be converted. Format is |
Returns
A local date, or null
if invalid input is given.
Examples
date = parseLocalDateQuiet("1995-08-02")
dateinvalid = parseLocalDateQuiet("1995e-08-02")
println date
println dateinvalid
- Log