- java.time - Discussion
- java.time - Month
- java.time - ZoneOffset
- java.time - ZoneId
- java.time - ZonedDateTime
- java.time - YearMonth
- java.time - Year
- java.time - Period
- java.time - OffsetTime
- java.time - OffsetDateTime
- java.time - MonthDay
- java.time - LocalTime
- java.time - LocalDateTime
- java.time - LocalDate
- java.time - Instant
- java.time - Duration
- java.time - Clock
- java.time - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
java.time.ZoneOffset Class
Introduction
The java.time.ZoneOffset class represents a time-zone offset from Greenwich/UTC, such as +02:00.
Class declaration
Following is the declaration for java.time.ZoneOffset class −
pubpc final class ZoneOffset extends ZoneId implements TemporalAccessor, TemporalAdjuster, Comparable<ZoneOffset>, Seriapzable
Field
Following are the fields for Java.time.ZoneOffset class −
static ZoneOffset MAX − Constant for the maximum supported offset.
static ZoneOffset MIN − Constant for the minimum supported offset.
static ZoneOffset UTC − The time-zone offset for UTC, with an ID of Z .
Class methods
Sr.No. | Method & Description |
---|---|
1 | Adjusts the specified temporal object to have the same offset as this object. |
2 | Compares this offset to another offset in descending order. |
3 | Checks if this offset is equal to another offset. |
4 | Obtains an instance of ZoneOffset from a temporal object. |
5 | Gets the value of the specified field from this offset as an int. |
6 | Gets the normapzed zone offset ID. |
7 | Gets the value of the specified field from this offset as a long. |
8 | Gets the associated time-zone rules. |
9 | Gets the total zone offset in seconds. |
10 | A hash code for this offset. |
11 | Checks if the specified field is supported. |
12 | Obtains an instance of ZoneOffset using the ID. |
13 | Obtains an instance of ZoneOffset using an offset in hours. |
14 | Obtains an instance of ZoneOffset using an offset in hours and minutes. |
15 | Obtains an instance of ZoneOffset using an offset in hours, minutes and seconds. |
16 | Obtains an instance of ZoneOffset specifying the total offset in seconds. |
17 | Queries this offset using the specified query. |
18 | Gets the range of vapd values for the specified field. |
19 | Outputs this offset as a String, using the normapzed ID. |
Methods inherited
This class inherits methods from the following classes −
Java.time.ZoneId
Java.lang.Object