detectAndParse

open fun detectAndParse(value: String): Duration

Detect the style then parse the value to return a duration.

Return

the parsed duration

Parameters

value

the value to parse

Throws

if the value is not a known style or cannot beparsed


open fun detectAndParse(value: String, unit: ChronoUnit): Duration

Detect the style then parse the value to return a duration.

Return

the parsed duration

Parameters

value

the value to parse

unit

the duration unit to use if the value doesn't specify one (null will default to ms)

Throws

if the value is not a known style or cannot beparsed