Uses of Class
java.time.LocalTime
| Package | Description |
|---|---|
| java.sql |
Provides the API for accessing and processing data stored in a
data source (usually a relational database) using the
Java™ 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.temporal |
Access to date and time using fields and units, and date time adjusters.
|
| java.time.zone |
Support for time-zones and their rules.
|
-
Uses of LocalTime in java.sql
Methods in java.sql that return LocalTime Modifier and Type Method Description LocalTimeTime. toLocalTime()Converts thisTimeobject to aLocalTime. -
Uses of LocalTime in java.time
Fields in java.time declared as LocalTime Modifier and Type Field Description static LocalTimeLocalTime. MAXThe maximum supportedLocalTime, '23:59:59.999999999'.static LocalTimeLocalTime. MIDNIGHTThe time of midnight at the start of the day, '00:00'.static LocalTimeLocalTime. MINThe minimum supportedLocalTime, '00:00'.static LocalTimeLocalTime. NOONThe time of noon in the middle of the day, '12:00'.Methods in java.time that return LocalTime Modifier and Type Method Description static LocalTimeLocalTime. from(TemporalAccessor temporal)Obtains an instance ofLocalTimefrom a temporal object.LocalTimeLocalTime. minus(long amountToSubtract, TemporalUnit unit)Returns a copy of this time with the specified amount subtracted.LocalTimeLocalTime. minus(TemporalAmount amountToSubtract)Returns a copy of this time with the specified amount subtracted.LocalTimeLocalTime. minusHours(long hoursToSubtract)Returns a copy of thisLocalTimewith the specified number of hours subtracted.LocalTimeLocalTime. minusMinutes(long minutesToSubtract)Returns a copy of thisLocalTimewith the specified number of minutes subtracted.LocalTimeLocalTime. minusNanos(long nanosToSubtract)Returns a copy of thisLocalTimewith the specified number of nanoseconds subtracted.LocalTimeLocalTime. minusSeconds(long secondsToSubtract)Returns a copy of thisLocalTimewith the specified number of seconds subtracted.static LocalTimeLocalTime. now()Obtains the current time from the system clock in the default time-zone.static LocalTimeLocalTime. now(Clock clock)Obtains the current time from the specified clock.static LocalTimeLocalTime. now(ZoneId zone)Obtains the current time from the system clock in the specified time-zone.static LocalTimeLocalTime. of(int hour, int minute)Obtains an instance ofLocalTimefrom an hour and minute.static LocalTimeLocalTime. of(int hour, int minute, int second)Obtains an instance ofLocalTimefrom an hour, minute and second.static LocalTimeLocalTime. of(int hour, int minute, int second, int nanoOfSecond)Obtains an instance ofLocalTimefrom an hour, minute, second and nanosecond.static LocalTimeLocalTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofLocalTimefrom anInstantand zone ID.static LocalTimeLocalTime. ofNanoOfDay(long nanoOfDay)Obtains an instance ofLocalTimefrom a nanos-of-day value.static LocalTimeLocalTime. ofSecondOfDay(long secondOfDay)Obtains an instance ofLocalTimefrom a second-of-day value.static LocalTimeLocalTime. parse(CharSequence text)Obtains an instance ofLocalTimefrom a text string such as10:15.static LocalTimeLocalTime. parse(CharSequence text, DateTimeFormatter formatter)Obtains an instance ofLocalTimefrom a text string using a specific formatter.LocalTimeLocalTime. plus(long amountToAdd, TemporalUnit unit)Returns a copy of this time with the specified amount added.LocalTimeLocalTime. plus(TemporalAmount amountToAdd)Returns a copy of this time with the specified amount added.LocalTimeLocalTime. plusHours(long hoursToAdd)Returns a copy of thisLocalTimewith the specified number of hours added.LocalTimeLocalTime. plusMinutes(long minutesToAdd)Returns a copy of thisLocalTimewith the specified number of minutes added.LocalTimeLocalTime. plusNanos(long nanosToAdd)Returns a copy of thisLocalTimewith the specified number of nanoseconds added.LocalTimeLocalTime. plusSeconds(long secondstoAdd)Returns a copy of thisLocalTimewith the specified number of seconds added.LocalTimeLocalDateTime. toLocalTime()Gets theLocalTimepart of this date-time.LocalTimeOffsetDateTime. toLocalTime()Gets theLocalTimepart of this date-time.LocalTimeOffsetTime. toLocalTime()Gets theLocalTimepart of this date-time.LocalTimeZonedDateTime. toLocalTime()Gets theLocalTimepart of this date-time.LocalTimeLocalTime. truncatedTo(TemporalUnit unit)Returns a copy of thisLocalTimewith the time truncated.LocalTimeLocalTime. with(TemporalAdjuster adjuster)Returns an adjusted copy of this time.LocalTimeLocalTime. with(TemporalField field, long newValue)Returns a copy of this time with the specified field set to a new value.LocalTimeLocalTime. withHour(int hour)Returns a copy of thisLocalTimewith the hour-of-day altered.LocalTimeLocalTime. withMinute(int minute)Returns a copy of thisLocalTimewith the minute-of-hour altered.LocalTimeLocalTime. withNano(int nanoOfSecond)Returns a copy of thisLocalTimewith the nano-of-second altered.LocalTimeLocalTime. withSecond(int second)Returns a copy of thisLocalTimewith the second-of-minute altered.Methods in java.time with parameters of type LocalTime Modifier and Type Method Description LocalDateTimeLocalDate. atTime(LocalTime time)Combines this date with a time to create aLocalDateTime.intLocalTime. compareTo(LocalTime other)Compares this time to another time.booleanLocalTime. isAfter(LocalTime other)Checks if this time is after the specified time.booleanLocalTime. isBefore(LocalTime other)Checks if this time is before the specified time.static LocalDateTimeLocalDateTime. of(LocalDate date, LocalTime time)Obtains an instance ofLocalDateTimefrom a date and time.static OffsetDateTimeOffsetDateTime. of(LocalDate date, LocalTime time, ZoneOffset offset)Obtains an instance ofOffsetDateTimefrom a date, time and offset.static OffsetTimeOffsetTime. of(LocalTime time, ZoneOffset offset)Obtains an instance ofOffsetTimefrom a local time and an offset.static ZonedDateTimeZonedDateTime. of(LocalDate date, LocalTime time, ZoneId zone)Obtains 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 of LocalTime in java.time.chrono
Methods in java.time.chrono that return LocalTime Modifier and Type Method Description LocalTimeChronoLocalDateTime. toLocalTime()Gets the local time part of this date-time.default LocalTimeChronoZonedDateTime. toLocalTime()Gets the local time part of this date-time.Methods in java.time.chrono with parameters of type LocalTime Modifier and Type Method Description default ChronoLocalDateTime<?>ChronoLocalDate. atTime(LocalTime localTime)Combines this date with a time to create aChronoLocalDateTime.ChronoLocalDateTime<HijrahDate>HijrahDate. atTime(LocalTime localTime)ChronoLocalDateTime<JapaneseDate>JapaneseDate. atTime(LocalTime localTime)ChronoLocalDateTime<MinguoDate>MinguoDate. atTime(LocalTime localTime)ChronoLocalDateTime<ThaiBuddhistDate>ThaiBuddhistDate. atTime(LocalTime localTime) -
Uses of LocalTime in java.time.temporal
Methods in java.time.temporal that return types with arguments of type LocalTime Modifier and Type Method Description static TemporalQuery<LocalTime>TemporalQueries. localTime()A query forLocalTimereturning null if not found. -
Uses of LocalTime in java.time.zone
Methods in java.time.zone that return LocalTime Modifier and Type Method Description LocalTimeZoneOffsetTransitionRule. getLocalTime()Gets the local time of day of the transition which must be checked withZoneOffsetTransitionRule.isMidnightEndOfDay().Methods in java.time.zone with parameters of type LocalTime Modifier and Type Method Description static ZoneOffsetTransitionRuleZoneOffsetTransitionRule. of(Month month, int dayOfMonthIndicator, DayOfWeek dayOfWeek, LocalTime time, boolean timeEndOfDay, ZoneOffsetTransitionRule.TimeDefinition timeDefnition, ZoneOffset standardOffset, ZoneOffset offsetBefore, ZoneOffset offsetAfter)Obtains an instance defining the yearly rule to create transitions between two offsets.