Uses of Class
java.time.LocalDateTime
Packages that useLocalDateTime
Package
Description
Provides the API for accessing and processing data stored in a data source (usually a relational database) using the Java programming language.
The main API for dates, times, instants, and durations.
Generic API for calendar systems other than the default ISO.
Support for time-zones and their rules.
Provides classes for reading and writing the standard ZIP and GZIP file formats.
Uses ofLocalDateTime injava.sql
Methods injava.sql that returnLocalDateTimeModifier and TypeMethodDescriptionTimestamp.toLocalDateTime()Converts thisTimestampobject to aLocalDateTime.Methods injava.sql with parameters of typeLocalDateTimeModifier and TypeMethodDescriptionstaticTimestampTimestamp.valueOf(LocalDateTime dateTime) Obtains an instance ofTimestampfrom aLocalDateTimeobject, with the same year, month, day of month, hours, minutes, seconds and nanos date-time value as the providedLocalDateTime.Uses ofLocalDateTime injava.time
Fields injava.time declared asLocalDateTimeModifier and TypeFieldDescriptionstatic finalLocalDateTimeLocalDateTime.MAXThe maximum supportedLocalDateTime, '+999999999-12-31T23:59:59.999999999'.static finalLocalDateTimeLocalDateTime.MINThe minimum supportedLocalDateTime, '-999999999-01-01T00:00:00'.Methods injava.time that returnLocalDateTimeModifier and TypeMethodDescriptionCombines this time with a date to create aLocalDateTime.LocalDate.atStartOfDay()Combines this date with the time of midnight to create aLocalDateTimeat the start of this date.LocalDate.atTime(int hour, int minute) Combines this date with a time to create aLocalDateTime.LocalDate.atTime(int hour, int minute, int second) Combines this date with a time to create aLocalDateTime.LocalDate.atTime(int hour, int minute, int second, int nanoOfSecond) Combines this date with a time to create aLocalDateTime.Combines this date with a time to create aLocalDateTime.staticLocalDateTimeLocalDateTime.from(TemporalAccessor temporal) Obtains an instance ofLocalDateTimefrom a temporal object.LocalDateTime.minus(long amountToSubtract,TemporalUnit unit) Returns a copy of this date-time with the specified amount subtracted.LocalDateTime.minus(TemporalAmount amountToSubtract) Returns a copy of this date-time with the specified amount subtracted.LocalDateTime.minusDays(long days) Returns a copy of thisLocalDateTimewith the specified number of days subtracted.LocalDateTime.minusHours(long hours) Returns a copy of thisLocalDateTimewith the specified number of hours subtracted.LocalDateTime.minusMinutes(long minutes) Returns a copy of thisLocalDateTimewith the specified number of minutes subtracted.LocalDateTime.minusMonths(long months) Returns a copy of thisLocalDateTimewith the specified number of months subtracted.LocalDateTime.minusNanos(long nanos) Returns a copy of thisLocalDateTimewith the specified number of nanoseconds subtracted.LocalDateTime.minusSeconds(long seconds) Returns a copy of thisLocalDateTimewith the specified number of seconds subtracted.LocalDateTime.minusWeeks(long weeks) Returns a copy of thisLocalDateTimewith the specified number of weeks subtracted.LocalDateTime.minusYears(long years) Returns a copy of thisLocalDateTimewith the specified number of years subtracted.staticLocalDateTimeLocalDateTime.now()Obtains the current date-time from the system clock in the default time-zone.staticLocalDateTimeObtains the current date-time from the specified clock.staticLocalDateTimeObtains the current date-time from the system clock in the specified time-zone.staticLocalDateTimeLocalDateTime.of(int year, int month, int dayOfMonth, int hour, int minute) Obtains an instance ofLocalDateTimefrom year, month, day, hour and minute, setting the second and nanosecond to zero.staticLocalDateTimeLocalDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second) Obtains an instance ofLocalDateTimefrom year, month, day, hour, minute and second, setting the nanosecond to zero.staticLocalDateTimeLocalDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofLocalDateTimefrom year, month, day, hour, minute, second and nanosecond.staticLocalDateTimeObtains an instance ofLocalDateTimefrom year, month, day, hour and minute, setting the second and nanosecond to zero.staticLocalDateTimeObtains an instance ofLocalDateTimefrom year, month, day, hour, minute and second, setting the nanosecond to zero.staticLocalDateTimeLocalDateTime.of(int year,Month month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofLocalDateTimefrom year, month, day, hour, minute, second and nanosecond.staticLocalDateTimeObtains an instance ofLocalDateTimefrom a date and time.staticLocalDateTimeLocalDateTime.ofEpochSecond(long epochSecond, int nanoOfSecond,ZoneOffset offset) Obtains an instance ofLocalDateTimeusing seconds from the epoch of 1970-01-01T00:00:00Z.staticLocalDateTimeObtains an instance ofLocalDateTimefrom anInstantand zone ID.staticLocalDateTimeLocalDateTime.parse(CharSequence text) Obtains an instance ofLocalDateTimefrom a text string such as2007-12-03T10:15:30.staticLocalDateTimeLocalDateTime.parse(CharSequence text,DateTimeFormatter formatter) Obtains an instance ofLocalDateTimefrom a text string using a specific formatter.LocalDateTime.plus(long amountToAdd,TemporalUnit unit) Returns a copy of this date-time with the specified amount added.LocalDateTime.plus(TemporalAmount amountToAdd) Returns a copy of this date-time with the specified amount added.LocalDateTime.plusDays(long days) Returns a copy of thisLocalDateTimewith the specified number of days added.LocalDateTime.plusHours(long hours) Returns a copy of thisLocalDateTimewith the specified number of hours added.LocalDateTime.plusMinutes(long minutes) Returns a copy of thisLocalDateTimewith the specified number of minutes added.LocalDateTime.plusMonths(long months) Returns a copy of thisLocalDateTimewith the specified number of months added.LocalDateTime.plusNanos(long nanos) Returns a copy of thisLocalDateTimewith the specified number of nanoseconds added.LocalDateTime.plusSeconds(long seconds) Returns a copy of thisLocalDateTimewith the specified number of seconds added.LocalDateTime.plusWeeks(long weeks) Returns a copy of thisLocalDateTimewith the specified number of weeks added.LocalDateTime.plusYears(long years) Returns a copy of thisLocalDateTimewith the specified number of years added.OffsetDateTime.toLocalDateTime()Gets theLocalDateTimepart of this date-time.ZonedDateTime.toLocalDateTime()Gets theLocalDateTimepart of this date-time.LocalDateTime.truncatedTo(TemporalUnit unit) Returns a copy of thisLocalDateTimewith the time truncated.LocalDateTime.with(TemporalAdjuster adjuster) Returns an adjusted copy of this date-time.LocalDateTime.with(TemporalField field, long newValue) Returns a copy of this date-time with the specified field set to a new value.LocalDateTime.withDayOfMonth(int dayOfMonth) Returns a copy of thisLocalDateTimewith the day-of-month altered.LocalDateTime.withDayOfYear(int dayOfYear) Returns a copy of thisLocalDateTimewith the day-of-year altered.LocalDateTime.withHour(int hour) Returns a copy of thisLocalDateTimewith the hour-of-day altered.LocalDateTime.withMinute(int minute) Returns a copy of thisLocalDateTimewith the minute-of-hour altered.LocalDateTime.withMonth(int month) Returns a copy of thisLocalDateTimewith the month-of-year altered.LocalDateTime.withNano(int nanoOfSecond) Returns a copy of thisLocalDateTimewith the nano-of-second altered.LocalDateTime.withSecond(int second) Returns a copy of thisLocalDateTimewith the second-of-minute altered.LocalDateTime.withYear(int year) Returns a copy of thisLocalDateTimewith the year altered.Methods injava.time with parameters of typeLocalDateTimeModifier and TypeMethodDescriptionstaticOffsetDateTimeOffsetDateTime.of(LocalDateTime dateTime,ZoneOffset offset) Obtains an instance ofOffsetDateTimefrom a date-time and offset.staticZonedDateTimeZonedDateTime.of(LocalDateTime localDateTime,ZoneId zone) Obtains an instance ofZonedDateTimefrom a local date-time.staticZonedDateTimeZonedDateTime.ofInstant(LocalDateTime localDateTime,ZoneOffset offset,ZoneId zone) Obtains an instance ofZonedDateTimefrom the instant formed by combining the local date-time and offset.staticZonedDateTimeZonedDateTime.ofLocal(LocalDateTime localDateTime,ZoneId zone,ZoneOffset preferredOffset) Obtains an instance ofZonedDateTimefrom a local date-time using the preferred offset if possible.staticZonedDateTimeZonedDateTime.ofStrict(LocalDateTime localDateTime,ZoneOffset offset,ZoneId zone) Obtains an instance ofZonedDateTimestrictly validating the combination of local date-time, offset and zone ID.Uses ofLocalDateTime injava.time.chrono
Methods injava.time.chrono that returnLocalDateTimeModifier and TypeMethodDescriptionIsoChronology.localDateTime(TemporalAccessor temporal) Obtains an ISO local date-time from another date-time object.Uses ofLocalDateTime injava.time.zone
Methods injava.time.zone that returnLocalDateTimeModifier and TypeMethodDescriptionZoneOffsetTransitionRule.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.ZoneOffsetTransition.getDateTimeAfter()Gets the local transition date-time, as would be expressed with the 'after' offset.ZoneOffsetTransition.getDateTimeBefore()Gets the local transition date-time, as would be expressed with the 'before' offset.Methods injava.time.zone with parameters of typeLocalDateTimeModifier and TypeMethodDescriptionZoneOffsetTransitionRule.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.ZoneRules.getOffset(LocalDateTime localDateTime) Gets a suitable offset for the specified local date-time in these rules.ZoneRules.getTransition(LocalDateTime localDateTime) Gets the offset transition applicable at the specified local date-time in these rules.ZoneRules.getValidOffsets(LocalDateTime localDateTime) Gets the offset applicable at the specified local date-time in these rules.booleanZoneRules.isValidOffset(LocalDateTime localDateTime,ZoneOffset offset) Checks if the offset date-time is valid for these rules.staticZoneOffsetTransitionZoneOffsetTransition.of(LocalDateTime transition,ZoneOffset offsetBefore,ZoneOffset offsetAfter) Obtains an instance defining a transition between two offsets.Uses ofLocalDateTime injava.util.zip
Methods injava.util.zip that returnLocalDateTimeModifier and TypeMethodDescriptionZipEntry.getTimeLocal()Returns the last modification time of the entry in local date-time.Methods injava.util.zip with parameters of typeLocalDateTimeModifier and TypeMethodDescriptionvoidZipEntry.setTimeLocal(LocalDateTime time) Sets the last modification time of the entry in local date-time.