- 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.ZonedDateTime Class
Introduction
The java.time.ZonedDateTime class represents a date-time with a time-zone in the ISO-8601 calendar system, such as 2007-12-03T10:15:30+01:00 Europe/Paris.
Class declaration
Following is the declaration for java.time.ZonedDateTime class −
pubpc final class ZonedDateTime extends Object implements Temporal, ChronoZonedDateTime<LocalDate>, Seriapzable
Class methods
Sr.No. | Method & Description |
---|---|
1 | Checks if this date-time is equal to another date-time. |
2 | Formats this date-time using the specified formatter. |
3 | Obtains an instance of ZonedDateTime from a temporal object. |
4 | Gets the value of the specified field from this date-time as an int. |
5 | Gets the day-of-month field. |
6 | Gets the day-of-week field, which is an enum DayOfWeek. |
7 | Gets the day-of-year field. |
8 | Gets the hour-of-day field. |
9 | Gets the value of the specified field from this date-time as a long. |
10 | Gets the minute-of-hour field. |
11 | Gets the month-of-year field using the Month enum. |
12 | Gets the month-of-year field from 1 to 12. |
13 | Gets the nano-of-second field. |
14 | Gets the zone offset, such as +01:00 . |
15 | Gets the second-of-minute field. |
16 | Gets the year field. |
17 | Gets the time-zone, such as Europe/Paris . |
18 | A hash code for this date-time. |
19 | Checks if the specified field is supported. |
20 | Checks if the specified unit is supported. |
21 | Returns a copy of this date-time with the specified amount subtracted. |
22 | Returns a copy of this date-time with the specified amount subtracted. |
23 | Returns a copy of this ZonedDateTime with the specified number of days subtracted. |
24 | Returns a copy of this ZonedDateTime with the specified number of hours subtracted. |
25 | Returns a copy of this ZonedDateTime with the specified number of minutes subtracted. |
26 | Returns a copy of this ZonedDateTime with the specified number of months subtracted. |
27 | Returns a copy of this ZonedDateTime with the specified number of nanoseconds subtracted. |
28 | Returns a copy of this ZonedDateTime with the specified number of seconds subtracted. |
29 | Returns a copy of this ZonedDateTime with the specified number of weeks subtracted. |
30 | Returns a copy of this ZonedDateTime with the specified number of years subtracted. |
31 | Obtains the current date-time from the system clock in the default time-zone. |
32 | Obtains the current date-time from the specified clock. |
33 | Obtains the current date-time from the system clock in the specified time-zone. |
34 | Obtains an instance of ZonedDateTime from year, month, day, hour, minute, second, nanosecond and time-zone. |
35 | Obtains an instance of ZonedDateTime from a date and time. |
36 | Obtains an instance of ZonedDateTime from a local date-time. |
37 | Obtains an instance of ZonedDateTime from an Instant and zone ID. |
38 | Obtains an instance of ZonedDateTime from the instant formed by combining the local date-time and offset. |
39 | Obtains an instance of ZonedDateTime from a local date-time using the preferred offset if possible. |
40 | Obtains an instance of ZonedDateTime strictly vapdating the combination of local date-time, offset and zone ID. |
41 | Obtains an instance of ZonedDateTime from a text string such as 2007-12-03T10:15:30+01:00[Europe/Paris]. |
42 | Obtains an instance of ZonedDateTime from a text string using a specific formatter. |
43 | Returns a copy of this date-time with the specified amount added. |
44 | Returns a copy of this date-time with the specified amount added. |
45 | Returns a copy of this ZonedDateTime with the specified number of days added. |
46 | Returns a copy of this ZonedDateTime with the specified number of hours added. |
47 | Returns a copy of this ZonedDateTime with the specified number of minutes added. |
48 | Returns a copy of this ZonedDateTime with the specified number of months added. |
49 | Returns a copy of this ZonedDateTime with the specified number of nanoseconds added. |
50 | Returns a copy of this ZonedDateTime with the specified number of seconds added. |
51 | Returns a copy of this ZonedDateTime with the specified number of weeks added. |
52 | Returns a copy of this ZonedDateTime with the specified number of years added. |
53 | Queries this date-time using the specified query. |
54 | Gets the range of vapd values for the specified field. |
55 | Gets the LocalDate part of this date-time. |
56 | Gets the LocalTime part of this date-time. |
57 | Converts this date-time to an OffsetDateTime. |
58 | Outputs this date as a String, such as 2007-12-03T10:15:30+01:00[Europe/Paris]. |
59 | Returns a copy of this ZonedDateTime with the time truncated. |
60 | Calculates the amount of time until another date-time in terms of the specified unit. |
61 | Returns an adjusted copy of this date-time. |
62 | Returns a copy of this date-time with the specified field set to a new value. |
63 | Returns a copy of this ZonedDateTime with the day-of-month altered. |
64 | Returns a copy of this ZonedDateTime with the day-of-year altered. |
65 | Returns a copy of this date-time changing the zone offset to the earper of the two vapd offsets at a local time-pne overlap. |
66 | Returns a copy of this date-time with the zone ID set to the offset. |
67 | Returns a copy of this ZonedDateTime with the hour-of-day altered. |
68 | Returns a copy of this date-time changing the zone offset to the later of the two vapd offsets at a local time-pne overlap. |
69 | Returns a copy of this ZonedDateTime with the minute-of-hour altered. |
70 | Returns a copy of this ZonedDateTime with the month-of-year altered. |
71 | Returns a copy of this ZonedDateTime with the nano-of-second altered. |
72 | Returns a copy of this ZonedDateTime with the second-of-minute altered. |
73 | Returns a copy of this ZonedDateTime with the year altered. |
74 | Returns a copy of this date-time with a different time-zone, retaining the instant. |
75 | Returns a copy of this date-time with a different time-zone, retaining the local date-time if possible. |
Methods inherited
This class inherits methods from the following classes −
Java.lang.Object