Java java.time LocalTime fields, constructors, methods, implement or subclass

Example usage for Java java.time LocalTime fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.time LocalTime.

The text is from its open source code.

Field

LocalTimeMIN
The minimum supported LocalTime , '00:00'.
LocalTimeMAX
The maximum supported LocalTime , '23:59:59.999999999'.
LocalTimeMIDNIGHT
The time of midnight at the start of the day, '00:00'.
LocalTimeNOON
The time of noon in the middle of the day, '12:00'.

Method

TemporaladjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same time as this object.
LocalDateTimeatDate(LocalDate date)
Combines this time with a date to create a LocalDateTime .
OffsetTimeatOffset(ZoneOffset offset)
Combines this time with an offset to create an OffsetTime .
intcompareTo(LocalTime other)
Compares this time to another time.
booleanequals(Object obj)
Checks if this time is equal to another time.
Stringformat(DateTimeFormatter formatter)
Formats this time using the specified formatter.
LocalTimefrom(TemporalAccessor temporal)
Obtains an instance of LocalTime from a temporal object.
intget(TemporalField field)
Gets the value of the specified field from this time as an int .
intgetHour()
Gets the hour-of-day field.
longgetLong(TemporalField field)
Gets the value of the specified field from this time as a long .
intgetMinute()
Gets the minute-of-hour field.
intgetNano()
Gets the nano-of-second field.
intgetSecond()
Gets the second-of-minute field.
inthashCode()
A hash code for this time.
booleanisAfter(LocalTime other)
Checks if this time is after the specified time.
booleanisBefore(LocalTime other)
Checks if this time is before the specified time.
booleanisSupported(TemporalField field)
Checks if the specified field is supported.
booleanisSupported(TemporalUnit unit)
Checks if the specified unit is supported.
LocalTimeminus(long amountToSubtract, TemporalUnit unit)
Returns a copy of this time with the specified amount subtracted.
LocalTimeminus(TemporalAmount amountToSubtract)
Returns a copy of this time with the specified amount subtracted.
LocalTimeminusHours(long hoursToSubtract)
Returns a copy of this LocalTime with the specified number of hours subtracted.
LocalTimeminusMinutes(long minutesToSubtract)
Returns a copy of this LocalTime with the specified number of minutes subtracted.
LocalTimeminusNanos(long nanosToSubtract)
Returns a copy of this LocalTime with the specified number of nanoseconds subtracted.
LocalTimeminusSeconds(long secondsToSubtract)
Returns a copy of this LocalTime with the specified number of seconds subtracted.
LocalTimenow()
Obtains the current time from the system clock in the default time-zone.
LocalTimenow(ZoneId zone)
Obtains the current time from the system clock in the specified time-zone.
LocalTimenow(Clock clock)
Obtains the current time from the specified clock.
LocalTimeof(int hour, int minute)
Obtains an instance of LocalTime from an hour and minute.
LocalTimeof(int hour, int minute, int second, int nanoOfSecond)
Obtains an instance of LocalTime from an hour, minute, second and nanosecond.
LocalTimeof(int hour, int minute, int second)
Obtains an instance of LocalTime from an hour, minute and second.
LocalTimeofNanoOfDay(long nanoOfDay)
Obtains an instance of LocalTime from a nanos-of-day value.
LocalTimeofSecondOfDay(long secondOfDay)
Obtains an instance of LocalTime from a second-of-day value.
LocalTimeparse(CharSequence text)
Obtains an instance of LocalTime from a text string such as 10:15 .
LocalTimeparse(CharSequence text, DateTimeFormatter formatter)
Obtains an instance of LocalTime from a text string using a specific formatter.
LocalTimeplus(long amountToAdd, TemporalUnit unit)
Returns a copy of this time with the specified amount added.
LocalTimeplus(TemporalAmount amountToAdd)
Returns a copy of this time with the specified amount added.
LocalTimeplusHours(long hoursToAdd)
Returns a copy of this LocalTime with the specified number of hours added.
LocalTimeplusMinutes(long minutesToAdd)
Returns a copy of this LocalTime with the specified number of minutes added.
LocalTimeplusNanos(long nanosToAdd)
Returns a copy of this LocalTime with the specified number of nanoseconds added.
LocalTimeplusSeconds(long secondstoAdd)
Returns a copy of this LocalTime with the specified number of seconds added.
Rquery(TemporalQuery query)
Queries this time using the specified query.
ValueRangerange(TemporalField field)
Gets the range of valid values for the specified field.
longtoNanoOfDay()
Extracts the time as nanos of day, from 0 to 24 * 60 * 60 * 1,000,000,000 - 1 .
inttoSecondOfDay()
Extracts the time as seconds of day, from 0 to 24 * 60 * 60 - 1 .
StringtoString()
Outputs this time as a String , such as 10:15 .
LocalTimetruncatedTo(TemporalUnit unit)
Returns a copy of this LocalTime with the time truncated.
longuntil(Temporal endExclusive, TemporalUnit unit)
Calculates the amount of time until another time in terms of the specified unit.
LocalTimewith(TemporalAdjuster adjuster)
Returns an adjusted copy of this time.
LocalTimewith(TemporalField field, long newValue)
Returns a copy of this time with the specified field set to a new value.
LocalTimewithHour(int hour)
Returns a copy of this LocalTime with the hour-of-day altered.
LocalTimewithMinute(int minute)
Returns a copy of this LocalTime with the minute-of-hour altered.
LocalTimewithNano(int nanoOfSecond)
Returns a copy of this LocalTime with the nano-of-second altered.
LocalTimewithSecond(int second)
Returns a copy of this LocalTime with the second-of-minute altered.