toOffsetTime

fun OffsetDateTime.toOffsetTime(): OffsetTime
fun ZonedDateTime.toOffsetTime(): OffsetTime

Returns the combined time and UTC offset.

fun String.toOffsetTime(): OffsetTime

Converts a string to an OffsetTime.

The string is assumed to be an ISO-8601 time with the UTC offset in extended format. For example, 02:30+01:00 or 14:40:23Z. The output of OffsetTime.toString can be safely parsed using this method.

Throws

if the parsed time or offset is invalid

fun String.toOffsetTime(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): OffsetTime

Converts a string to an OffsetTime using a specific parser.

A set of predefined parsers can be found in DateTimeParsers.

Any custom parser must be capable of supplying the fields necessary to resolve both a Time and UtcOffset.

Throws

if the parsed time or offset is invalid