parseTimeZoneQuiet
The parseTimeZoneQuiet
method parses the supplied string as a time zone.
"Quiet" methods return null
instead of throwing an exception when encountering a string that cannot be parsed.
Syntax
parseTimeZoneQuiet(s)
Parameters
Parameter | Type | Description |
---|---|---|
s | string | The string to be converted. |
Returns
A ZoneId, or null
if invalid input is given.
Examples
tz = parseTimeZoneQuiet("America/Los_Angeles")
tz2 = parseTimeZoneQuiet("Amurica/Los_Angeles")
println epochMillisToZonedDateTime(100, tz)
println epochMillisToZonedDateTime(100, tz2)
- Log