Uses of Class
java.time.ZonedDateTime
| 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.util |
Contains the collections framework, some internationalization support classes,
a service loader, properties, random number generation, string parsing
and scanning classes, base64 encoding and decoding, a bit array, and
several miscellaneous utility classes.
|
-
Uses of ZonedDateTime in java.time
Methods in java.time that return ZonedDateTime Modifier and Type Method Description ZonedDateTimeLocalDate. atStartOfDay(ZoneId zone)Returns a zoned date-time from this date at the earliest valid time according to the rules in the time-zone.ZonedDateTimeInstant. atZone(ZoneId zone)Combines this instant with a time-zone to create aZonedDateTime.ZonedDateTimeLocalDateTime. atZone(ZoneId zone)Combines this date-time with a time-zone to create aZonedDateTime.ZonedDateTimeOffsetDateTime. atZoneSameInstant(ZoneId zone)Combines this date-time with a time-zone to create aZonedDateTimeensuring that the result has the same instant.ZonedDateTimeOffsetDateTime. atZoneSimilarLocal(ZoneId zone)Combines this date-time with a time-zone to create aZonedDateTimetrying to keep the same local date and time.static ZonedDateTimeZonedDateTime. from(TemporalAccessor temporal)Obtains an instance ofZonedDateTimefrom a temporal object.ZonedDateTimeZonedDateTime. minus(long amountToSubtract, TemporalUnit unit)Returns a copy of this date-time with the specified amount subtracted.ZonedDateTimeZonedDateTime. minus(TemporalAmount amountToSubtract)Returns a copy of this date-time with the specified amount subtracted.ZonedDateTimeZonedDateTime. minusDays(long days)Returns a copy of thisZonedDateTimewith the specified number of days subtracted.ZonedDateTimeZonedDateTime. minusHours(long hours)Returns a copy of thisZonedDateTimewith the specified number of hours subtracted.ZonedDateTimeZonedDateTime. minusMinutes(long minutes)Returns a copy of thisZonedDateTimewith the specified number of minutes subtracted.ZonedDateTimeZonedDateTime. minusMonths(long months)Returns a copy of thisZonedDateTimewith the specified number of months subtracted.ZonedDateTimeZonedDateTime. minusNanos(long nanos)Returns a copy of thisZonedDateTimewith the specified number of nanoseconds subtracted.ZonedDateTimeZonedDateTime. minusSeconds(long seconds)Returns a copy of thisZonedDateTimewith the specified number of seconds subtracted.ZonedDateTimeZonedDateTime. minusWeeks(long weeks)Returns a copy of thisZonedDateTimewith the specified number of weeks subtracted.ZonedDateTimeZonedDateTime. minusYears(long years)Returns a copy of thisZonedDateTimewith the specified number of years subtracted.static ZonedDateTimeZonedDateTime. now()Obtains the current date-time from the system clock in the default time-zone.static ZonedDateTimeZonedDateTime. now(Clock clock)Obtains the current date-time from the specified clock.static ZonedDateTimeZonedDateTime. now(ZoneId zone)Obtains the current date-time from the system clock in the specified time-zone.static ZonedDateTimeZonedDateTime. of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneId zone)Obtains an instance ofZonedDateTimefrom a year, month, day, hour, minute, second, nanosecond and time-zone.static ZonedDateTimeZonedDateTime. of(LocalDate date, LocalTime time, ZoneId zone)Obtains an instance ofZonedDateTimefrom a local date and time.static ZonedDateTimeZonedDateTime. of(LocalDateTime localDateTime, ZoneId zone)Obtains an instance ofZonedDateTimefrom a local date-time.static ZonedDateTimeZonedDateTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofZonedDateTimefrom anInstant.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 ZonedDateTimeZonedDateTime. ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)Obtains an instance ofZonedDateTimestrictly validating the combination of local date-time, offset and zone ID.static ZonedDateTimeZonedDateTime. parse(CharSequence text)Obtains an instance ofZonedDateTimefrom a text string such as2007-12-03T10:15:30+01:00[Europe/Paris].static ZonedDateTimeZonedDateTime. parse(CharSequence text, DateTimeFormatter formatter)Obtains an instance ofZonedDateTimefrom a text string using a specific formatter.ZonedDateTimeZonedDateTime. plus(long amountToAdd, TemporalUnit unit)Returns a copy of this date-time with the specified amount added.ZonedDateTimeZonedDateTime. plus(TemporalAmount amountToAdd)Returns a copy of this date-time with the specified amount added.ZonedDateTimeZonedDateTime. plusDays(long days)Returns a copy of thisZonedDateTimewith the specified number of days added.ZonedDateTimeZonedDateTime. plusHours(long hours)Returns a copy of thisZonedDateTimewith the specified number of hours added.ZonedDateTimeZonedDateTime. plusMinutes(long minutes)Returns a copy of thisZonedDateTimewith the specified number of minutes added.ZonedDateTimeZonedDateTime. plusMonths(long months)Returns a copy of thisZonedDateTimewith the specified number of months added.ZonedDateTimeZonedDateTime. plusNanos(long nanos)Returns a copy of thisZonedDateTimewith the specified number of nanoseconds added.ZonedDateTimeZonedDateTime. plusSeconds(long seconds)Returns a copy of thisZonedDateTimewith the specified number of seconds added.ZonedDateTimeZonedDateTime. plusWeeks(long weeks)Returns a copy of thisZonedDateTimewith the specified number of weeks added.ZonedDateTimeZonedDateTime. plusYears(long years)Returns a copy of thisZonedDateTimewith the specified number of years added.ZonedDateTimeOffsetDateTime. toZonedDateTime()Converts this date-time to aZonedDateTimeusing the offset as the zone ID.ZonedDateTimeZonedDateTime. truncatedTo(TemporalUnit unit)Returns a copy of thisZonedDateTimewith the time truncated.ZonedDateTimeZonedDateTime. with(TemporalAdjuster adjuster)Returns an adjusted copy of this date-time.ZonedDateTimeZonedDateTime. with(TemporalField field, long newValue)Returns a copy of this date-time with the specified field set to a new value.ZonedDateTimeZonedDateTime. withDayOfMonth(int dayOfMonth)Returns a copy of thisZonedDateTimewith the day-of-month altered.ZonedDateTimeZonedDateTime. withDayOfYear(int dayOfYear)Returns a copy of thisZonedDateTimewith the day-of-year altered.ZonedDateTimeZonedDateTime. withEarlierOffsetAtOverlap()Returns a copy of this date-time changing the zone offset to the earlier of the two valid offsets at a local time-line overlap.ZonedDateTimeZonedDateTime. withFixedOffsetZone()Returns a copy of this date-time with the zone ID set to the offset.ZonedDateTimeZonedDateTime. withHour(int hour)Returns a copy of thisZonedDateTimewith the hour-of-day altered.ZonedDateTimeZonedDateTime. withLaterOffsetAtOverlap()Returns a copy of this date-time changing the zone offset to the later of the two valid offsets at a local time-line overlap.ZonedDateTimeZonedDateTime. withMinute(int minute)Returns a copy of thisZonedDateTimewith the minute-of-hour altered.ZonedDateTimeZonedDateTime. withMonth(int month)Returns a copy of thisZonedDateTimewith the month-of-year altered.ZonedDateTimeZonedDateTime. withNano(int nanoOfSecond)Returns a copy of thisZonedDateTimewith the nano-of-second altered.ZonedDateTimeZonedDateTime. withSecond(int second)Returns a copy of thisZonedDateTimewith the second-of-minute altered.ZonedDateTimeZonedDateTime. withYear(int year)Returns a copy of thisZonedDateTimewith the year altered.ZonedDateTimeZonedDateTime. withZoneSameInstant(ZoneId zone)Returns a copy of this date-time with a different time-zone, retaining the instant.ZonedDateTimeZonedDateTime. withZoneSameLocal(ZoneId zone)Returns a copy of this date-time with a different time-zone, retaining the local date-time if possible. -
Uses of ZonedDateTime in java.time.chrono
Methods in java.time.chrono that return ZonedDateTime Modifier and Type Method Description ZonedDateTimeIsoChronology. zonedDateTime(Instant instant, ZoneId zone)Obtains an ISO zoned date-time in this chronology from anInstant.ZonedDateTimeIsoChronology. zonedDateTime(TemporalAccessor temporal)Obtains an ISO zoned date-time from another date-time object. -
Uses of ZonedDateTime in java.util
Methods in java.util that return ZonedDateTime Modifier and Type Method Description ZonedDateTimeGregorianCalendar. toZonedDateTime()Converts this object to aZonedDateTimethat represents the same point on the time-line as thisGregorianCalendar.Methods in java.util with parameters of type ZonedDateTime Modifier and Type Method Description static GregorianCalendarGregorianCalendar. from(ZonedDateTime zdt)Obtains an instance ofGregorianCalendarwith the default locale from aZonedDateTimeobject.