detectAndParse

open fun detectAndParse(value: String): Period

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

Return

the parsed period

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): Period

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

Return

the parsed period

Parameters

value

the value to parse

unit

the period 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