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, legacy collection classes, event model,
date and time facilities, internationalization, and miscellaneous utility
classes (a string tokenizer, a random-number generator, and a bit array).
|
Modifier and Type | Method and Description |
---|---|
ZonedDateTime |
LocalDate.atStartOfDay(ZoneId zone)
Returns a zoned date-time from this date at the earliest valid time according
to the rules in the time-zone.
|
ZonedDateTime |
Instant.atZone(ZoneId zone)
Combines this instant with a time-zone to create a
ZonedDateTime . |
ZonedDateTime |
LocalDateTime.atZone(ZoneId zone)
Combines this date-time with a time-zone to create a
ZonedDateTime . |
ZonedDateTime |
OffsetDateTime.atZoneSameInstant(ZoneId zone)
Combines this date-time with a time-zone to create a
ZonedDateTime
ensuring that the result has the same instant. |
ZonedDateTime |
OffsetDateTime.atZoneSimilarLocal(ZoneId zone)
Combines this date-time with a time-zone to create a
ZonedDateTime
trying to keep the same local date and time. |
static ZonedDateTime |
ZonedDateTime.from(TemporalAccessor temporal)
Obtains an instance of
ZonedDateTime from a temporal object. |
ZonedDateTime |
ZonedDateTime.minus(long amountToSubtract,
TemporalUnit unit)
Returns a copy of this date-time with the specified amount subtracted.
|
ZonedDateTime |
ZonedDateTime.minus(TemporalAmount amountToSubtract)
Returns a copy of this date-time with the specified amount subtracted.
|
ZonedDateTime |
ZonedDateTime.minusDays(long days)
Returns a copy of this
ZonedDateTime with the specified number of days subtracted. |
ZonedDateTime |
ZonedDateTime.minusHours(long hours)
Returns a copy of this
ZonedDateTime with the specified number of hours subtracted. |
ZonedDateTime |
ZonedDateTime.minusMinutes(long minutes)
Returns a copy of this
ZonedDateTime with the specified number of minutes subtracted. |
ZonedDateTime |
ZonedDateTime.minusMonths(long months)
Returns a copy of this
ZonedDateTime with the specified number of months subtracted. |
ZonedDateTime |
ZonedDateTime.minusNanos(long nanos)
Returns a copy of this
ZonedDateTime with the specified number of nanoseconds subtracted. |
ZonedDateTime |
ZonedDateTime.minusSeconds(long seconds)
Returns a copy of this
ZonedDateTime with the specified number of seconds subtracted. |
ZonedDateTime |
ZonedDateTime.minusWeeks(long weeks)
Returns a copy of this
ZonedDateTime with the specified number of weeks subtracted. |
ZonedDateTime |
ZonedDateTime.minusYears(long years)
Returns a copy of this
ZonedDateTime with the specified number of years subtracted. |
static ZonedDateTime |
ZonedDateTime.now()
Obtains the current date-time from the system clock in the default time-zone.
|
static ZonedDateTime |
ZonedDateTime.now(Clock clock)
Obtains the current date-time from the specified clock.
|
static ZonedDateTime |
ZonedDateTime.now(ZoneId zone)
Obtains the current date-time from the system clock in the specified time-zone.
|
static ZonedDateTime |
ZonedDateTime.of(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
int nanoOfSecond,
ZoneId zone)
Obtains an instance of
ZonedDateTime from a year, month, day,
hour, minute, second, nanosecond and time-zone. |
static ZonedDateTime |
ZonedDateTime.of(LocalDate date,
LocalTime time,
ZoneId zone)
Obtains an instance of
ZonedDateTime from a local date and time. |
static ZonedDateTime |
ZonedDateTime.of(LocalDateTime localDateTime,
ZoneId zone)
Obtains an instance of
ZonedDateTime from a local date-time. |
static ZonedDateTime |
ZonedDateTime.ofInstant(Instant instant,
ZoneId zone)
Obtains an instance of
ZonedDateTime from an Instant . |
static ZonedDateTime |
ZonedDateTime.ofInstant(LocalDateTime localDateTime,
ZoneOffset offset,
ZoneId zone)
Obtains an instance of
ZonedDateTime from the instant formed by combining
the local date-time and offset. |
static ZonedDateTime |
ZonedDateTime.ofLocal(LocalDateTime localDateTime,
ZoneId zone,
ZoneOffset preferredOffset)
Obtains an instance of
ZonedDateTime from a local date-time
using the preferred offset if possible. |
static ZonedDateTime |
ZonedDateTime.ofStrict(LocalDateTime localDateTime,
ZoneOffset offset,
ZoneId zone)
Obtains an instance of
ZonedDateTime strictly validating the
combination of local date-time, offset and zone ID. |
static ZonedDateTime |
ZonedDateTime.parse(CharSequence text)
Obtains an instance of
ZonedDateTime from a text string such as
2007-12-03T10:15:30+01:00[Europe/Paris] . |
static ZonedDateTime |
ZonedDateTime.parse(CharSequence text,
DateTimeFormatter formatter)
Obtains an instance of
ZonedDateTime from a text string using a specific formatter. |
ZonedDateTime |
ZonedDateTime.plus(long amountToAdd,
TemporalUnit unit)
Returns a copy of this date-time with the specified amount added.
|
ZonedDateTime |
ZonedDateTime.plus(TemporalAmount amountToAdd)
Returns a copy of this date-time with the specified amount added.
|
ZonedDateTime |
ZonedDateTime.plusDays(long days)
Returns a copy of this
ZonedDateTime with the specified number of days added. |
ZonedDateTime |
ZonedDateTime.plusHours(long hours)
Returns a copy of this
ZonedDateTime with the specified number of hours added. |
ZonedDateTime |
ZonedDateTime.plusMinutes(long minutes)
Returns a copy of this
ZonedDateTime with the specified number of minutes added. |
ZonedDateTime |
ZonedDateTime.plusMonths(long months)
Returns a copy of this
ZonedDateTime with the specified number of months added. |
ZonedDateTime |
ZonedDateTime.plusNanos(long nanos)
Returns a copy of this
ZonedDateTime with the specified number of nanoseconds added. |
ZonedDateTime |
ZonedDateTime.plusSeconds(long seconds)
Returns a copy of this
ZonedDateTime with the specified number of seconds added. |
ZonedDateTime |
ZonedDateTime.plusWeeks(long weeks)
Returns a copy of this
ZonedDateTime with the specified number of weeks added. |
ZonedDateTime |
ZonedDateTime.plusYears(long years)
Returns a copy of this
ZonedDateTime with the specified number of years added. |
ZonedDateTime |
OffsetDateTime.toZonedDateTime()
Converts this date-time to a
ZonedDateTime using the offset as the zone ID. |
ZonedDateTime |
ZonedDateTime.truncatedTo(TemporalUnit unit)
Returns a copy of this
ZonedDateTime with the time truncated. |
ZonedDateTime |
ZonedDateTime.with(TemporalAdjuster adjuster)
Returns an adjusted copy of this date-time.
|
ZonedDateTime |
ZonedDateTime.with(TemporalField field,
long newValue)
Returns a copy of this date-time with the specified field set to a new value.
|
ZonedDateTime |
ZonedDateTime.withDayOfMonth(int dayOfMonth)
Returns a copy of this
ZonedDateTime with the day-of-month altered. |
ZonedDateTime |
ZonedDateTime.withDayOfYear(int dayOfYear)
Returns a copy of this
ZonedDateTime with the day-of-year altered. |
ZonedDateTime |
ZonedDateTime.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.
|
ZonedDateTime |
ZonedDateTime.withFixedOffsetZone()
Returns a copy of this date-time with the zone ID set to the offset.
|
ZonedDateTime |
ZonedDateTime.withHour(int hour)
Returns a copy of this
ZonedDateTime with the hour-of-day altered. |
ZonedDateTime |
ZonedDateTime.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.
|
ZonedDateTime |
ZonedDateTime.withMinute(int minute)
Returns a copy of this
ZonedDateTime with the minute-of-hour altered. |
ZonedDateTime |
ZonedDateTime.withMonth(int month)
Returns a copy of this
ZonedDateTime with the month-of-year altered. |
ZonedDateTime |
ZonedDateTime.withNano(int nanoOfSecond)
Returns a copy of this
ZonedDateTime with the nano-of-second altered. |
ZonedDateTime |
ZonedDateTime.withSecond(int second)
Returns a copy of this
ZonedDateTime with the second-of-minute altered. |
ZonedDateTime |
ZonedDateTime.withYear(int year)
Returns a copy of this
ZonedDateTime with the year altered. |
ZonedDateTime |
ZonedDateTime.withZoneSameInstant(ZoneId zone)
Returns a copy of this date-time with a different time-zone,
retaining the instant.
|
ZonedDateTime |
ZonedDateTime.withZoneSameLocal(ZoneId zone)
Returns a copy of this date-time with a different time-zone,
retaining the local date-time if possible.
|
Modifier and Type | Method and Description |
---|---|
ZonedDateTime |
IsoChronology.zonedDateTime(Instant instant,
ZoneId zone)
Obtains an ISO zoned date-time in this chronology from an
Instant . |
ZonedDateTime |
IsoChronology.zonedDateTime(TemporalAccessor temporal)
Obtains an ISO zoned date-time from another date-time object.
|
Modifier and Type | Method and Description |
---|---|
ZonedDateTime |
GregorianCalendar.toZonedDateTime()
Converts this object to a
ZonedDateTime that represents
the same point on the time-line as this GregorianCalendar . |
Modifier and Type | Method and Description |
---|---|
static GregorianCalendar |
GregorianCalendar.from(ZonedDateTime zdt)
Obtains an instance of
GregorianCalendar with the default locale
from a ZonedDateTime object. |
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2018, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.