| Package | Description |
|---|---|
| java.time |
The main API for dates, times, instants, and durations.
|
| java.time.chrono |
Generic API for calendar systems other than the default ISO.
|
| java.time.temporal |
Access to date and time using fields and units, and date time adjusters.
|
| java.time.zone |
Support for time-zones and their rules.
|
| Modifier and Type | Field and Description |
|---|---|
static ZoneOffset |
ZoneOffset.MAX
Constant for the maximum supported offset.
|
static ZoneOffset |
ZoneOffset.MIN
Constant for the maximum supported offset.
|
static ZoneOffset |
ZoneOffset.UTC
The time-zone offset for UTC, with an ID of 'Z'.
|
| Modifier and Type | Method and Description |
|---|---|
static ZoneOffset |
ZoneOffset.from(TemporalAccessor
Obtains an instance of
ZoneOffset from a temporal object.
|
ZoneOffset |
OffsetTime.getOffset()
Gets the zone offset, such as '+01:00'.
|
ZoneOffset |
ZonedDateTime.getOffset()
Gets the zone offset, such as '+01:00'.
|
ZoneOffset |
OffsetDateTime.getOffset()
Gets the zone offset, such as '+01:00'.
|
static ZoneOffset |
ZoneOffset.of(String
Obtains an instance of
ZoneOffset using the ID.
|
static ZoneOffset |
ZoneOffset.ofHours(int hours)
Obtains an instance of
ZoneOffset using an offset in hours.
|
static ZoneOffset |
ZoneOffset.ofHoursMinutes(int hours, int minutes)
Obtains an instance of
ZoneOffset using an offset in hours and minutes.
|
static ZoneOffset |
ZoneOffset.ofHoursMinutesSeconds(int hours, int minutes, int seconds)
Obtains an instance of
ZoneOffset using an offset in hours, minutes and seconds.
|
static ZoneOffset |
ZoneOffset.ofTotalSeconds(int totalSeconds)
Obtains an instance of
ZoneOffset specifying the total offset in seconds
|
| Modifier and Type | Method and Description |
|---|---|
OffsetTime |
LocalTime.atOffset(ZoneOffset
Combines this time with an offset to create an
OffsetTime.
|
OffsetDateTime |
LocalDateTime.atOffset(ZoneOffset
Combines this date-time with an offset to create an
OffsetDateTime.
|
OffsetDateTime |
Instant.atOffset(ZoneOffset
Combines this instant with an offset to create an
OffsetDateTime.
|
int |
ZoneOffset.compareTo(ZoneOffset
Compares this offset to another offset in descending order.
|
static OffsetDateTime |
OffsetDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset
Obtains an instance of
OffsetDateTime from a year, month, day, hour, minute, second, nanosecond and offset.
|
static OffsetTime |
OffsetTime.of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset
Obtains an instance of
OffsetTime from an hour, minute, second and nanosecond.
|
static OffsetDateTime |
OffsetDateTime.of(LocalDate
Obtains an instance of
OffsetDateTime from a date, time and offset.
|
static OffsetDateTime |
OffsetDateTime.of(LocalDateTime
Obtains an instance of
OffsetDateTime from a date-time and offset.
|
static OffsetTime |
OffsetTime.of(LocalTime
Obtains an instance of
OffsetTime from a local time and an offset.
|
static LocalDateTime |
LocalDateTime.ofEpochSecond(long epochSecond, int nanoOfSecond, ZoneOffset
Obtains an instance of
LocalDateTime using seconds from the epoch of 1970-01-01T00:00:00Z.
|
static ZonedDateTime |
ZonedDateTime.ofInstant(LocalDateTime
Obtains an instance of
ZonedDateTime from the instant formed by combining the local date-time and offset.
|
static ZonedDateTime |
ZonedDateTime.ofLocal(LocalDateTime
Obtains an instance of
ZonedDateTime from a local date-time using the preferred offset if possible.
|
static ZoneId |
ZoneId.ofOffset(String
Obtains an instance of
ZoneId wrapping an offset.
|
static ZonedDateTime |
ZonedDateTime.ofStrict(LocalDateTime
Obtains an instance of
ZonedDateTime strictly validating the combination of local date-time, offset and zone ID.
|
OffsetTime |
OffsetTime.withOffsetSameInstant(ZoneOffset
Returns a copy of this
OffsetTime with the specified offset ensuring that the result is at the same instant on an implied day.
|
OffsetDateTime |
OffsetDateTime.withOffsetSameInstant(ZoneOffset
Returns a copy of this
OffsetDateTime with the specified offset ensuring that the result is at the same instant.
|
OffsetTime |
OffsetTime.withOffsetSameLocal(ZoneOffset
Returns a copy of this
OffsetTime with the specified offset ensuring that the result has the same local time.
|
OffsetDateTime |
OffsetDateTime.withOffsetSameLocal(ZoneOffset
Returns a copy of this
OffsetDateTime with the specified offset ensuring that the result has the same local date-time.
|
| Modifier and Type | Method and Description |
|---|---|
ZoneOffset |
ChronoZonedDateTime.getOffset()
Gets the zone offset, such as '+01:00'.
|
| Modifier and Type | Method and Description |
|---|---|
default long |
ChronoLocalDateTime.toEpochSecond(ZoneOffset
Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.
|
default Instant |
ChronoLocalDateTime.toInstant(ZoneOffset
Converts this date-time to an
Instant.
|
| Modifier and Type | Method and Description |
|---|---|
static TemporalQuery |
TemporalQueries.offset()
A query for
ZoneOffset returning null if not found.
|
| Modifier and Type | Method and Description |
|---|---|
ZoneOffset |
ZoneRules.getOffset(Instant
Gets the offset applicable at the specified instant in these rules.
|
ZoneOffset |
ZoneRules.getOffset(LocalDateTime
Gets a suitable offset for the specified local date-time in these rules.
|
ZoneOffset |
ZoneOffsetTransition.getOffsetAfter()
Gets the offset after the transition.
|
ZoneOffset |
ZoneOffsetTransitionRule.getOffsetAfter()
Gets the offset after the transition.
|
ZoneOffset |
ZoneOffsetTransition.getOffsetBefore()
Gets the offset before the transition.
|
ZoneOffset |
ZoneOffsetTransitionRule.getOffsetBefore()
Gets the offset before the transition.
|
ZoneOffset |
ZoneOffsetTransitionRule.getStandardOffset()
Gets the standard offset in force at the transition.
|
ZoneOffset |
ZoneRules.getStandardOffset(Instant
Gets the standard offset for the specified instant in this zone.
|
| Modifier and Type | Method and Description |
|---|---|
List |
ZoneRules.getValidOffsets(LocalDateTime
Gets the offset applicable at the specified local date-time in these rules.
|
| Modifier and Type | Method and Description |
|---|---|
LocalDateTime |
ZoneOffsetTransitionRule.TimeDefinition.createDateTime(LocalDateTime
Converts the specified local date-time to the local date-time actually seen on a wall clock.
|
boolean |
ZoneRules.isValidOffset(LocalDateTime
Checks if the offset date-time is valid for these rules.
|
boolean |
ZoneOffsetTransition.isValidOffset(ZoneOffset
Checks if the specified offset is valid during this transition.
|
static ZoneOffsetTransition |
ZoneOffsetTransition.of(LocalDateTime
Obtains an instance defining a transition between two offsets.
|
static ZoneOffsetTransitionRule |
ZoneOffsetTransitionRule.of(Month
Obtains an instance defining the yearly rule to create transitions between two offsets.
|
static ZoneRules |
ZoneRules.of(ZoneOffset
Obtains an instance of ZoneRules that has fixed zone rules.
|
static ZoneRules |
ZoneRules.of(ZoneOffset
Obtains an instance of a ZoneRules.
|