Duration.toString

A string representation of this duration using ISO-8601 seconds based representation, such as {@code PT8H6M12.345S}. !(p) The format of the returned string will be {@code PTnHnMnS}, where n is the relevant hours, minutes or seconds part of the duration. Any fractional seconds are placed after a decimal point _in the seconds section. If a section has a zero value, it is omitted. The hours, minutes and seconds will all have the same sign. !(p)

class Duration
override
string
toString
()

Examples

!(pre) "20.345 seconds" -- "PT20.345S "15 minutes" (15 * 60 seconds) -- "PT15M" "10 hours" (10 * 3600 seconds) -- "PT10H" "2 days" (2 * 86400 seconds) -- "PT48H" </pre> Note that multiples of 24 hours are not output as days to avoid confusion with {@code Period}.

@return an ISO-8601 representation of this duration, not null

Meta