Uses of Class
java.time.ZoneOffset
Packages that use ZoneOffset
Package
Description
The main API for dates, times, instants, and durations.
Generic API for calendar systems other than the default ISO.
Access to date and time using fields and units, and date time adjusters.
Support for time-zones and their rules.
-
Uses of ZoneOffset in java.time
Classes in java.time that implement interfaces with type arguments of type ZoneOffsetModifier and TypeClassDescriptionfinal classA time-zone offset from Greenwich/UTC, such as+02:00.Fields in java.time declared as ZoneOffsetModifier and TypeFieldDescriptionstatic final ZoneOffsetZoneOffset.MAXConstant for the maximum supported offset.static final ZoneOffsetZoneOffset.MINConstant for the minimum supported offset.static final ZoneOffsetZoneOffset.UTCThe time-zone offset for UTC, with an ID of 'Z'.Methods in java.time that return ZoneOffsetModifier and TypeMethodDescriptionstatic ZoneOffsetZoneOffset.from(TemporalAccessor temporal) Obtains an instance ofZoneOffsetfrom a temporal object.OffsetDateTime.getOffset()Gets the zone offset, such as '+01:00'.OffsetTime.getOffset()Gets the zone offset, such as '+01:00'.ZonedDateTime.getOffset()Gets the zone offset, such as '+01:00'.static ZoneOffsetObtains an instance ofZoneOffsetusing the ID.static ZoneOffsetZoneOffset.ofHours(int hours) Obtains an instance ofZoneOffsetusing an offset in hours.static ZoneOffsetZoneOffset.ofHoursMinutes(int hours, int minutes) Obtains an instance ofZoneOffsetusing an offset in hours and minutes.static ZoneOffsetZoneOffset.ofHoursMinutesSeconds(int hours, int minutes, int seconds) Obtains an instance ofZoneOffsetusing an offset in hours, minutes and seconds.static ZoneOffsetZoneOffset.ofTotalSeconds(int totalSeconds) Obtains an instance ofZoneOffsetspecifying the total offset in secondsMethods in java.time with parameters of type ZoneOffsetModifier and TypeMethodDescriptionInstant.atOffset(ZoneOffset offset) Combines this instant with an offset to create anOffsetDateTime.LocalDateTime.atOffset(ZoneOffset offset) Combines this date-time with an offset to create anOffsetDateTime.LocalTime.atOffset(ZoneOffset offset) Combines this time with an offset to create anOffsetTime.intZoneOffset.compareTo(ZoneOffset other) Compares this offset to another offset in descending order.static OffsetDateTimeOffsetDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) Obtains an instance ofOffsetDateTimefrom a year, month, day, hour, minute, second, nanosecond and offset.static OffsetDateTimeOffsetDateTime.of(LocalDate date, LocalTime time, ZoneOffset offset) Obtains an instance ofOffsetDateTimefrom a date, time and offset.static OffsetDateTimeOffsetDateTime.of(LocalDateTime dateTime, ZoneOffset offset) Obtains an instance ofOffsetDateTimefrom a date-time and offset.static OffsetTimeOffsetTime.of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) Obtains an instance ofOffsetTimefrom an hour, minute, second and nanosecond.static OffsetTimeOffsetTime.of(LocalTime time, ZoneOffset offset) Obtains an instance ofOffsetTimefrom a local time and an offset.static LocalDateTimeLocalDateTime.ofEpochSecond(long epochSecond, int nanoOfSecond, ZoneOffset offset) Obtains an instance ofLocalDateTimeusing seconds from the epoch of 1970-01-01T00:00:00Z.static ZonedDateTimeZonedDateTime.ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) Obtains an instance ofZonedDateTimefrom the instant formed by combining the local date-time and offset.static ZonedDateTimeZonedDateTime.ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset) Obtains an instance ofZonedDateTimefrom a local date-time using the preferred offset if possible.static ZoneIdZoneId.ofOffset(String prefix, ZoneOffset offset) Obtains an instance ofZoneIdwrapping an offset.static ZonedDateTimeZonedDateTime.ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) Obtains an instance ofZonedDateTimestrictly validating the combination of local date-time, offset and zone ID.longLocalDate.toEpochSecond(LocalTime time, ZoneOffset offset) Converts thisLocalDateto the number of seconds since the epoch of 1970-01-01T00:00:00Z.longLocalTime.toEpochSecond(LocalDate date, ZoneOffset offset) Converts thisLocalTimeto the number of seconds since the epoch of 1970-01-01T00:00:00Z.OffsetDateTime.withOffsetSameInstant(ZoneOffset offset) Returns a copy of thisOffsetDateTimewith the specified offset ensuring that the result is at the same instant.OffsetTime.withOffsetSameInstant(ZoneOffset offset) Returns a copy of thisOffsetTimewith the specified offset ensuring that the result is at the same instant on an implied day.OffsetDateTime.withOffsetSameLocal(ZoneOffset offset) Returns a copy of thisOffsetDateTimewith the specified offset ensuring that the result has the same local date-time.OffsetTime.withOffsetSameLocal(ZoneOffset offset) Returns a copy of thisOffsetTimewith the specified offset ensuring that the result has the same local time. -
Uses of ZoneOffset in java.time.chrono
Methods in java.time.chrono that return ZoneOffsetModifier and TypeMethodDescriptionChronoZonedDateTime.getOffset()Gets the zone offset, such as '+01:00'.Methods in java.time.chrono with parameters of type ZoneOffsetModifier and TypeMethodDescriptiondefault longChronology.epochSecond(int prolepticYear, int month, int dayOfMonth, int hour, int minute, int second, ZoneOffset zoneOffset) Gets the number of seconds from the epoch of 1970-01-01T00:00:00Z.default longChronology.epochSecond(Era era, int yearOfEra, int month, int dayOfMonth, int hour, int minute, int second, ZoneOffset zoneOffset) Gets the number of seconds from the epoch of 1970-01-01T00:00:00Z.longIsoChronology.epochSecond(int prolepticYear, int month, int dayOfMonth, int hour, int minute, int second, ZoneOffset zoneOffset) Gets the number of seconds from the epoch of 1970-01-01T00:00:00Z.default longChronoLocalDateTime.toEpochSecond(ZoneOffset offset) Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.default InstantChronoLocalDateTime.toInstant(ZoneOffset offset) Converts this date-time to anInstant. -
Uses of ZoneOffset in java.time.temporal
Methods in java.time.temporal that return types with arguments of type ZoneOffsetModifier and TypeMethodDescriptionstatic TemporalQuery<ZoneOffset> TemporalQueries.offset()A query forZoneOffsetreturning null if not found. -
Uses of ZoneOffset in java.time.zone
Methods in java.time.zone that return ZoneOffsetModifier and TypeMethodDescriptionGets the offset applicable at the specified instant in these rules.ZoneRules.getOffset(LocalDateTime localDateTime) Gets a suitable offset for the specified local date-time in these rules.ZoneOffsetTransition.getOffsetAfter()Gets the offset after the transition.ZoneOffsetTransitionRule.getOffsetAfter()Gets the offset after the transition.ZoneOffsetTransition.getOffsetBefore()Gets the offset before the transition.ZoneOffsetTransitionRule.getOffsetBefore()Gets the offset before the transition.ZoneOffsetTransitionRule.getStandardOffset()Gets the standard offset in force at the transition.ZoneRules.getStandardOffset(Instant instant) Gets the standard offset for the specified instant in this zone.Methods in java.time.zone that return types with arguments of type ZoneOffsetModifier and TypeMethodDescriptionZoneRules.getValidOffsets(LocalDateTime localDateTime) Gets the offset applicable at the specified local date-time in these rules.Methods in java.time.zone with parameters of type ZoneOffsetModifier and TypeMethodDescriptionZoneOffsetTransitionRule.TimeDefinition.createDateTime(LocalDateTime dateTime, ZoneOffset standardOffset, ZoneOffset wallOffset) Converts the specified local date-time to the local date-time actually seen on a wall clock.booleanZoneOffsetTransition.isValidOffset(ZoneOffset offset) Checks if the specified offset is valid during this transition.booleanZoneRules.isValidOffset(LocalDateTime localDateTime, ZoneOffset offset) Checks if the offset date-time is valid for these rules.static ZoneOffsetTransitionZoneOffsetTransition.of(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter) Obtains an instance defining a transition between two offsets.static ZoneOffsetTransitionRuleZoneOffsetTransitionRule.of(Month month, int dayOfMonthIndicator, DayOfWeek dayOfWeek, LocalTime time, boolean timeEndOfDay, ZoneOffsetTransitionRule.TimeDefinition timeDefinition, ZoneOffset standardOffset, ZoneOffset offsetBefore, ZoneOffset offsetAfter) Obtains an instance defining the yearly rule to create transitions between two offsets.static ZoneRulesZoneRules.of(ZoneOffset offset) Obtains an instance of ZoneRules that has fixed zone rules.static ZoneRulesZoneRules.of(ZoneOffset baseStandardOffset, ZoneOffset baseWallOffset, List<ZoneOffsetTransition> standardOffsetTransitionList, List<ZoneOffsetTransition> transitionList, List<ZoneOffsetTransitionRule> lastRules) Obtains an instance of a ZoneRules.