to Zoned Date Time
Converts this OffsetDateTime to a ZonedDateTime using the specified strategy to adjust it to a valid date, time, and offset in zone.
OffsetConversionStrategy.PRESERVE_INSTANT - Preserve the instant captured by the date, time, and offset, ignoring the local time.
OffsetConversionStrategy.PRESERVE_LOCAL_TIME - Preserve the local date and time in the new time zone, adjusting the offset if needed.
Alternatively, you can use asZonedDateTime to convert 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
Converts a string to a ZonedDateTime.
The string is assumed to be a complete ISO-8601 date and time representation in extended format, optionally including a non-standard region ID. For example, 2005-05-06T23:30+01 or 2005-05-06T23:30-04:00[America/New_York].
The output of ZonedDateTime.toString can be safely parsed using this method.
Throws
if parsing fails
if the parsed date-time is invalid
Converts a string to a ZonedDateTime using a specific parser.
A set of predefined parsers can be found in DateTimeParsers.
Throws
if parsing fails
if the parsed date-time is invalid