- 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.OffsetTime Class
Introduction
The java.time.OffsetTime class represents a time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 10:15:30+01:00.
Class declaration
Following is the declaration for java.time.OffsetTime class −
pubpc final class OffsetTime extends Object implements Temporal, TemporalAdjuster, Comparable<OffsetTime>, Seriapzable
Field
Following are the fields for java.time.OffsetTime class −
static OffsetTime MAX − The maximum supported OffsetTime, 23:59:59.999999999-18:00 .
static OffsetTime MIN − The minimum supported OffsetTime, 00:00:00+18:00 .
Class methods
Sr.No. | Method & Description |
---|---|
1 | Adjusts the specified temporal object to have the same date and time as this object. |
2 | Combines this time with a date to create a OffsetDateTime. |
3 | Compares this time to another time. |
4 | Checks if this time is equal to another time. |
5 | Formats this time using the specified formatter. |
6 | Obtains an instance of OffsetTime from a temporal object. |
7 | Gets the value of the specified field from this time as an int. |
8 | Gets the hour-of-day field. |
9 | Gets the value of the specified field from this time as a long. |
10 | Gets the minute-of-hour field. |
11 | Gets the nano-of-second field. |
12 | Gets the zone offset, such as +01:00 . |
13 | Gets the second-of-minute field. |
14 | A hash code for this time. |
15 | Checks if the instant of this OffsetTime is after that of the specified time applying both times to a common date. |
16 | Checks if the instant of this OffsetTime is before that of the specified time applying both times to a common date. |
17 | Checks if the instant of this OffsetTime is equal to that of the specified time applying both times to a common date. |
18 | Checks if the specified field is supported. |
19 | Checks if the specified unit is supported. |
20 | Returns a copy of this time with the specified amount subtracted. |
21 | Returns a copy of this time with the specified amount subtracted. |
22 | Returns a copy of this OffsetTime with the specified number of hours subtracted. |
23 | Returns a copy of this OffsetTime with the specified number of minutes subtracted. |
24 | Returns a copy of this OffsetTime with the specified number of nanoseconds subtracted. |
25 | Returns a copy of this OffsetTime with the specified number of seconds subtracted. |
26 | Obtains the current time from the system clock in the default time-zone. |
27 | Obtains the current time from the specified clock. |
28 | Obtains the current time from the system clock in the specified time-zone. |
29 | Obtains an instance of OffsetTime from an hour, minute, second, nanosecond and an offset. |
30 | Obtains an instance of OffsetTime from a local time and an offset. |
31 | Obtains an instance of OffsetTime from an Instant and zone ID. |
32 | Obtains an instance of OffsetTime from a text string such as 10:15:30+01:00. |
33 | Obtains an instance of OffsetTime from a text string using a specific formatter. |
34 | Returns a copy of this time with the specified amount added. |
35 | Returns a copy of this time with the specified amount added. |
36 | Returns a copy of this OffsetTime with the specified number of hours added. |
37 | Returns a copy of this OffsetTime with the specified number of minutes added. |
38 | Returns a copy of this OffsetTime with the specified number of nanoseconds added. |
39 | Returns a copy of this OffsetTime with the specified number of seconds added. |
40 | Queries this time using the specified query. |
41 | Gets the range of vapd values for the specified field. |
42 | Gets the LocalTime part of this date-time. |
43 | Outputs this date as a String, such as 10:15. |
44 | Returns a copy of this OffsetTime with the time truncated. |
45 | Calculates the amount of time until another time in terms of the specified unit. |
46 | Returns an adjusted copy of this time. |
47 | Returns a copy of this time with the specified field set to a new value. |
48 | Returns a copy of this OffsetTime with the hour-of-day altered. |
49 | Returns a copy of this OffsetTime with the minute-of-hour altered. |
50 | Returns a copy of this OffsetTime with the nano-of-second altered. |
51 | Returns a copy of this OffsetTime with the specified offset ensuring that the result is at the same instant on an impped day. |
52 | Returns a copy of this OffsetTime with the specified offset ensuring that the result has the same local time. |
53 | Returns a copy of this OffsetTime with the second-of-minute altered. |
Methods inherited
This class inherits methods from the following classes −
Java.lang.Object