Package | Description |
---|---|
java.sql |
Provides the API for accessing and processing data stored in a
data source (usually a relational database) using the
JavaTM programming language.
|
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.time.zone |
Support for time-zones and their rules.
|
Modifier and Type | Method and Description |
---|---|
LocalDateTime |
Timestamp.toLocalDateTime()
Converts this
Timestamp object to a LocalDateTime . |
Modifier and Type | Method and Description |
---|---|
static Timestamp |
Timestamp.valueOf(LocalDateTime dateTime)
Obtains an instance of
Timestamp from a LocalDateTime
object, with the same year, month, day of month, hours, minutes,
seconds and nanos date-time value as the provided LocalDateTime . |
Modifier and Type | Field and Description |
---|---|
static LocalDateTime |
LocalDateTime.MAX
The maximum supported
LocalDateTime , '+999999999-12-31T23:59:59.999999999'. |
static LocalDateTime |
LocalDateTime.MIN
The minimum supported
LocalDateTime , '-999999999-01-01T00:00:00'. |
Modifier and Type | Method and Description |
---|---|
LocalDateTime |
LocalTime.atDate(LocalDate date)
Combines this time with a date to create a
LocalDateTime . |
LocalDateTime |
LocalDate.atStartOfDay()
Combines this date with the time of midnight to create a
LocalDateTime
at the start of this date. |
LocalDateTime |
LocalDate.atTime(int hour,
int minute)
Combines this date with a time to create a
LocalDateTime . |
LocalDateTime |
LocalDate.atTime(int hour,
int minute,
int second)
Combines this date with a time to create a
LocalDateTime . |
LocalDateTime |
LocalDate.atTime(int hour,
int minute,
int second,
int nanoOfSecond)
Combines this date with a time to create a
LocalDateTime . |
LocalDateTime |
LocalDate.atTime(LocalTime time)
Combines this date with a time to create a
LocalDateTime . |
static LocalDateTime |
LocalDateTime.from(TemporalAccessor temporal)
Obtains an instance of
LocalDateTime from a temporal object. |
LocalDateTime |
LocalDateTime.minus(long amountToSubtract,
TemporalUnit unit)
Returns a copy of this date-time with the specified amount subtracted.
|
LocalDateTime |
LocalDateTime.minus(TemporalAmount amountToSubtract)
Returns a copy of this date-time with the specified amount subtracted.
|
LocalDateTime |
LocalDateTime.minusDays(long days)
Returns a copy of this
LocalDateTime with the specified number of days subtracted. |
LocalDateTime |
LocalDateTime.minusHours(long hours)
Returns a copy of this
LocalDateTime with the specified number of hours subtracted. |
LocalDateTime |
LocalDateTime.minusMinutes(long minutes)
Returns a copy of this
LocalDateTime with the specified number of minutes subtracted. |
LocalDateTime |
LocalDateTime.minusMonths(long months)
Returns a copy of this
LocalDateTime with the specified number of months subtracted. |
LocalDateTime |
LocalDateTime.minusNanos(long nanos)
Returns a copy of this
LocalDateTime with the specified number of nanoseconds subtracted. |
LocalDateTime |
LocalDateTime.minusSeconds(long seconds)
Returns a copy of this
LocalDateTime with the specified number of seconds subtracted. |
LocalDateTime |
LocalDateTime.minusWeeks(long weeks)
Returns a copy of this
LocalDateTime with the specified number of weeks subtracted. |
LocalDateTime |
LocalDateTime.minusYears(long years)
Returns a copy of this
LocalDateTime with the specified number of years subtracted. |
static LocalDateTime |
LocalDateTime.now()
Obtains the current date-time from the system clock in the default time-zone.
|
static LocalDateTime |
LocalDateTime.now(Clock clock)
Obtains the current date-time from the specified clock.
|
static LocalDateTime |
LocalDateTime.now(ZoneId zone)
Obtains the current date-time from the system clock in the specified time-zone.
|
static LocalDateTime |
LocalDateTime.of(int year,
int month,
int dayOfMonth,
int hour,
int minute)
Obtains an instance of
LocalDateTime from year, month,
day, hour and minute, setting the second and nanosecond to zero. |
static LocalDateTime |
LocalDateTime.of(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second)
Obtains an instance of
LocalDateTime from year, month,
day, hour, minute and second, setting the nanosecond to zero. |
static LocalDateTime |
LocalDateTime.of(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
int nanoOfSecond)
Obtains an instance of
LocalDateTime from year, month,
day, hour, minute, second and nanosecond. |
static LocalDateTime |
LocalDateTime.of(int year,
Month month,
int dayOfMonth,
int hour,
int minute)
Obtains an instance of
LocalDateTime from year, month,
day, hour and minute, setting the second and nanosecond to zero. |
static LocalDateTime |
LocalDateTime.of(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second)
Obtains an instance of
LocalDateTime from year, month,
day, hour, minute and second, setting the nanosecond to zero. |
static LocalDateTime |
LocalDateTime.of(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second,
int nanoOfSecond)
Obtains an instance of
LocalDateTime from year, month,
day, hour, minute, second and nanosecond. |
static LocalDateTime |
LocalDateTime.of(LocalDate date,
LocalTime time)
Obtains an instance of
LocalDateTime from a date and time. |
static LocalDateTime |
LocalDateTime.ofEpochSecond(long epochSecond,
int nanoOfSecond,
ZoneOffset offset)
Obtains an instance of
LocalDateTime using seconds from the
epoch of 1970-01-01T00:00:00Z. |
static LocalDateTime |
LocalDateTime.ofInstant(Instant instant,
ZoneId zone)
Obtains an instance of
LocalDateTime from an Instant and zone ID. |
static LocalDateTime |
LocalDateTime.parse(CharSequence text)
Obtains an instance of
LocalDateTime from a text string such as 2007-12-03T10:15:30 . |
static LocalDateTime |
LocalDateTime.parse(CharSequence text,
DateTimeFormatter formatter)
Obtains an instance of
LocalDateTime from a text string using a specific formatter. |
LocalDateTime |
LocalDateTime.plus(long amountToAdd,
TemporalUnit unit)
Returns a copy of this date-time with the specified amount added.
|
LocalDateTime |
LocalDateTime.plus(TemporalAmount amountToAdd)
Returns a copy of this date-time with the specified amount added.
|
LocalDateTime |
LocalDateTime.plusDays(long days)
Returns a copy of this
LocalDateTime with the specified number of days added. |
LocalDateTime |
LocalDateTime.plusHours(long hours)
Returns a copy of this
LocalDateTime with the specified number of hours added. |
LocalDateTime |
LocalDateTime.plusMinutes(long minutes)
Returns a copy of this
LocalDateTime with the specified number of minutes added. |
LocalDateTime |
LocalDateTime.plusMonths(long months)
Returns a copy of this
LocalDateTime with the specified number of months added. |
LocalDateTime |
LocalDateTime.plusNanos(long nanos)
Returns a copy of this
LocalDateTime with the specified number of nanoseconds added. |
LocalDateTime |
LocalDateTime.plusSeconds(long seconds)
Returns a copy of this
LocalDateTime with the specified number of seconds added. |
LocalDateTime |
LocalDateTime.plusWeeks(long weeks)
Returns a copy of this
LocalDateTime with the specified number of weeks added. |
LocalDateTime |
LocalDateTime.plusYears(long years)
Returns a copy of this
LocalDateTime with the specified number of years added. |
LocalDateTime |
ZonedDateTime.toLocalDateTime()
Gets the
LocalDateTime part of this date-time. |
LocalDateTime |
OffsetDateTime.toLocalDateTime()
Gets the
LocalDateTime part of this date-time. |
LocalDateTime |
LocalDateTime.truncatedTo(TemporalUnit unit)
Returns a copy of this
LocalDateTime with the time truncated. |
LocalDateTime |
LocalDateTime.with(TemporalAdjuster adjuster)
Returns an adjusted copy of this date-time.
|
LocalDateTime |
LocalDateTime.with(TemporalField field,
long newValue)
Returns a copy of this date-time with the specified field set to a new value.
|
LocalDateTime |
LocalDateTime.withDayOfMonth(int dayOfMonth)
Returns a copy of this
LocalDateTime with the day-of-month altered. |
LocalDateTime |
LocalDateTime.withDayOfYear(int dayOfYear)
Returns a copy of this
LocalDateTime with the day-of-year altered. |
LocalDateTime |
LocalDateTime.withHour(int hour)
Returns a copy of this
LocalDateTime with the hour-of-day altered. |
LocalDateTime |
LocalDateTime.withMinute(int minute)
Returns a copy of this
LocalDateTime with the minute-of-hour altered. |
LocalDateTime |
LocalDateTime.withMonth(int month)
Returns a copy of this
LocalDateTime with the month-of-year altered. |
LocalDateTime |
LocalDateTime.withNano(int nanoOfSecond)
Returns a copy of this
LocalDateTime with the nano-of-second altered. |
LocalDateTime |
LocalDateTime.withSecond(int second)
Returns a copy of this
LocalDateTime with the second-of-minute altered. |
LocalDateTime |
LocalDateTime.withYear(int year)
Returns a copy of this
LocalDateTime with the year altered. |
Modifier and Type | Method and Description |
---|---|
static ZonedDateTime |
ZonedDateTime.of(LocalDateTime localDateTime,
ZoneId zone)
Obtains an instance of
ZonedDateTime from a local date-time. |
static OffsetDateTime |
OffsetDateTime.of(LocalDateTime dateTime,
ZoneOffset offset)
Obtains an instance of
OffsetDateTime from a date-time and offset. |
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. |
Modifier and Type | Method and Description |
---|---|
LocalDateTime |
IsoChronology.localDateTime(TemporalAccessor temporal)
Obtains an ISO local date-time from another date-time object.
|
Modifier and Type | Method and Description |
---|---|
LocalDateTime |
ZoneOffsetTransitionRule.TimeDefinition.createDateTime(LocalDateTime dateTime,
ZoneOffset standardOffset,
ZoneOffset wallOffset)
Converts the specified local date-time to the local date-time actually
seen on a wall clock.
|
LocalDateTime |
ZoneOffsetTransition.getDateTimeAfter()
Gets the local transition date-time, as would be expressed with the 'after' offset.
|
LocalDateTime |
ZoneOffsetTransition.getDateTimeBefore()
Gets the local transition date-time, as would be expressed with the 'before' offset.
|
Modifier and Type | Method and Description |
---|---|
LocalDateTime |
ZoneOffsetTransitionRule.TimeDefinition.createDateTime(LocalDateTime dateTime,
ZoneOffset standardOffset,
ZoneOffset wallOffset)
Converts the specified local date-time to the local date-time actually
seen on a wall clock.
|
ZoneOffset |
ZoneRules.getOffset(LocalDateTime localDateTime)
Gets a suitable offset for the specified local date-time in these rules.
|
ZoneOffsetTransition |
ZoneRules.getTransition(LocalDateTime localDateTime)
Gets the offset transition applicable at the specified local date-time in these rules.
|
List<ZoneOffset> |
ZoneRules.getValidOffsets(LocalDateTime localDateTime)
Gets the offset applicable at the specified local date-time in these rules.
|
boolean |
ZoneRules.isValidOffset(LocalDateTime localDateTime,
ZoneOffset offset)
Checks if the offset date-time is valid for these rules.
|
static ZoneOffsetTransition |
ZoneOffsetTransition.of(LocalDateTime transition,
ZoneOffset offsetBefore,
ZoneOffset offsetAfter)
Obtains an instance defining a transition between two offsets.
|
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, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.