Skip to main content
Version: Java (Groovy)

parseTimePrecisionQuiet

The parseTimePrecisionQuiet method returns an Enum indicating the level of precision in a time, date-time, or period nanos string. See ChronoField for a full list of Enums.

"Quiet" methods return null instead of throwing an exception when encountering a string that cannot be parsed.

Syntax

parseTimePrecisionQuiet(s)

Parameters

ParameterTypeDescription
sstring

The time or date-time to evaluate.

Returns

An enum indicating the evaluated string's level of precision, or null if invalid input is given.

Examples

time1 = parseTimePrecisionQuiet("1:00")

time_invalid = parseTimePrecisionQuiet("10:00f:00")

println time1

println time_invalid