Uses of Class
java.time.LocalTime
Packages that useLocalTime
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.
Access to date and time using fields and units, and date time adjusters.
Support for time-zones and their rules.
Uses ofLocalTime injava.sql
Uses ofLocalTime injava.time
Modifier and TypeFieldDescriptionstatic finalLocalTimeLocalTime.MAXThe maximum supportedLocalTime, '23:59:59.999999999'.static finalLocalTimeLocalTime.MIDNIGHTThe time of midnight at the start of the day, '00:00'.static finalLocalTimeLocalTime.MINThe minimum supportedLocalTime, '00:00'.static finalLocalTimeLocalTime.NOONThe time of noon in the middle of the day, '12:00'.Modifier and TypeMethodDescriptionstaticLocalTimeLocalTime.from(TemporalAccessor temporal) Obtains an instance ofLocalTimefrom a temporal object.LocalTime.minus(long amountToSubtract,TemporalUnit unit) Returns a copy of this time with the specified amount subtracted.LocalTime.minus(TemporalAmount amountToSubtract) Returns a copy of this time with the specified amount subtracted.LocalTime.minusHours(long hoursToSubtract) Returns a copy of thisLocalTimewith the specified number of hours subtracted.LocalTime.minusMinutes(long minutesToSubtract) Returns a copy of thisLocalTimewith the specified number of minutes subtracted.LocalTime.minusNanos(long nanosToSubtract) Returns a copy of thisLocalTimewith the specified number of nanoseconds subtracted.LocalTime.minusSeconds(long secondsToSubtract) Returns a copy of thisLocalTimewith the specified number of seconds subtracted.staticLocalTimeLocalTime.now()Obtains the current time from the system clock in the default time-zone.staticLocalTimeObtains the current time from the specified clock.staticLocalTimeObtains the current time from the system clock in the specified time-zone.staticLocalTimeLocalTime.of(int hour, int minute) Obtains an instance ofLocalTimefrom an hour and minute.staticLocalTimeLocalTime.of(int hour, int minute, int second) Obtains an instance ofLocalTimefrom an hour, minute and second.staticLocalTimeLocalTime.of(int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofLocalTimefrom an hour, minute, second and nanosecond.staticLocalTimeObtains an instance ofLocalTimefrom anInstantand zone ID.staticLocalTimeLocalTime.ofNanoOfDay(long nanoOfDay) Obtains an instance ofLocalTimefrom a nanos-of-day value.staticLocalTimeLocalTime.ofSecondOfDay(long secondOfDay) Obtains an instance ofLocalTimefrom a second-of-day value.staticLocalTimeLocalTime.parse(CharSequence text) Obtains an instance ofLocalTimefrom a text string such as10:15.staticLocalTimeLocalTime.parse(CharSequence text,DateTimeFormatter formatter) Obtains an instance ofLocalTimefrom a text string using a specific formatter.LocalTime.plus(long amountToAdd,TemporalUnit unit) Returns a copy of this time with the specified amount added.LocalTime.plus(TemporalAmount amountToAdd) Returns a copy of this time with the specified amount added.LocalTime.plusHours(long hoursToAdd) Returns a copy of thisLocalTimewith the specified number of hours added.LocalTime.plusMinutes(long minutesToAdd) Returns a copy of thisLocalTimewith the specified number of minutes added.LocalTime.plusNanos(long nanosToAdd) Returns a copy of thisLocalTimewith the specified number of nanoseconds added.LocalTime.plusSeconds(long secondstoAdd) Returns a copy of thisLocalTimewith the specified number of seconds added.LocalDateTime.toLocalTime()Gets theLocalTimepart of this date-time.OffsetDateTime.toLocalTime()Gets theLocalTimepart of this date-time.OffsetTime.toLocalTime()Gets theLocalTimepart of this date-time.ZonedDateTime.toLocalTime()Gets theLocalTimepart of this date-time.LocalTime.truncatedTo(TemporalUnit unit) Returns a copy of thisLocalTimewith the time truncated.LocalTime.with(TemporalAdjuster adjuster) Returns an adjusted copy of this time.LocalTime.with(TemporalField field, long newValue) Returns a copy of this time with the specified field set to a new value.LocalTime.withHour(int hour) Returns a copy of thisLocalTimewith the hour-of-day altered.LocalTime.withMinute(int minute) Returns a copy of thisLocalTimewith the minute-of-hour altered.LocalTime.withNano(int nanoOfSecond) Returns a copy of thisLocalTimewith the nano-of-second altered.LocalTime.withSecond(int second) Returns a copy of thisLocalTimewith the second-of-minute altered.Modifier and TypeMethodDescriptionCombines this date with a time to create aLocalDateTime.intCompares this time to another time.booleanChecks if this time is after the specified time.booleanChecks if this time is before the specified time.staticLocalDateTimeObtains an instance ofLocalDateTimefrom a date and time.staticOffsetDateTimeOffsetDateTime.of(LocalDate date,LocalTime time,ZoneOffset offset) Obtains an instance ofOffsetDateTimefrom a date, time and offset.staticOffsetTimeOffsetTime.of(LocalTime time,ZoneOffset offset) Obtains an instance ofOffsetTimefrom a local time and an offset.staticZonedDateTimeObtains an instance ofZonedDateTimefrom a local date and time.longLocalDate.toEpochSecond(LocalTime time,ZoneOffset offset) Converts thisLocalDateto the number of seconds since the epoch of 1970-01-01T00:00:00Z.Uses ofLocalTime injava.time.chrono
Methods injava.time.chrono that returnLocalTimeModifier and TypeMethodDescriptionChronoLocalDateTime.toLocalTime()Gets the local time part of this date-time.defaultLocalTimeChronoZonedDateTime.toLocalTime()Gets the local time part of this date-time.Methods injava.time.chrono with parameters of typeLocalTimeModifier and TypeMethodDescriptiondefaultChronoLocalDateTime<?>Combines this date with a time to create aChronoLocalDateTime.Uses ofLocalTime injava.time.temporal
Methods injava.time.temporal that return types with arguments of typeLocalTimeModifier and TypeMethodDescriptionstaticTemporalQuery<LocalTime>TemporalQueries.localTime()A query forLocalTimereturning null if not found.Uses ofLocalTime injava.time.zone
Methods injava.time.zone that returnLocalTimeModifier and TypeMethodDescriptionZoneOffsetTransitionRule.getLocalTime()Gets the local time of day of the transition which must be checked withZoneOffsetTransitionRule.isMidnightEndOfDay().Methods injava.time.zone with parameters of typeLocalTimeModifier and TypeMethodDescriptionstaticZoneOffsetTransitionRuleZoneOffsetTransitionRule.of(Month month, int dayOfMonthIndicator,DayOfWeek dayOfWeek,LocalTime time, boolean timeEndOfDay,ZoneOffsetTransitionRule.TimeDefinition timeDefinition,ZoneOffset standardOffset,ZoneOffset offsetBefore,ZoneOffset offsetAfter) Obtains an instance defining the yearly rule to create transitions between two offsets.