toZonedDateTimeInterval

Converts this interval to a ZonedDateTimeInterval using the specified strategy to adjust each endpoint to a valid date, time, and offset in zone.

Alternatively, you can use asZonedDateTimeInterval to convert each endpoint to a ZonedDateTime with an equivalent fixed-offset zone. However, this comes with the caveat that a fixed-offset zone lacks knowledge of any region and will not respond to daylight savings time changes.

See also

fun String.toZonedDateTimeInterval(): ZonedDateTimeInterval

Converts a string to a ZonedDateTimeInterval.

The string is assumed to be an ISO-8601 time interval representation in extended format. The output of ZonedDateTimeInterval.toString can be safely parsed using this method.

Examples:

  • 1990-01-04T03-05[America/New_York]/1991-08-30T15:30:05.123-04:00

  • ../1991-08-30T15:30:05.123-04:00

  • 1990-01-04T03-05[Europe/London]/..

  • ../..

  • (empty string)

Throws

fun String.toZonedDateTimeInterval(parser: GroupedDateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): ZonedDateTimeInterval

Converts a string to a ZonedDateTimeInterval using a specific parser.

A set of predefined parsers can be found in DateTimeParsers.

Throws