object LocalTime extends Serializable
- Alphabetic
- By Inheritance
- LocalTime
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- lazy val MAX: LocalTime
The maximum supported
LocalTime, '23:59:59.999999999'.The maximum supported
LocalTime, '23:59:59.999999999'. This is the time just before midnight at the end of the day. - lazy val MIDNIGHT: LocalTime
The time of midnight at the start of the day, '00:00'.
- lazy val MIN: LocalTime
The minimum supported
LocalTime, '00:00'.The minimum supported
LocalTime, '00:00'. This is the time of midnight at the start of the day. - lazy val NOON: LocalTime
The time of noon in the middle of the day, '12:00'.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def from(temporal: TemporalAccessor): LocalTime
Obtains an instance of
LocalTimefrom a temporal object.Obtains an instance of
LocalTimefrom a temporal object.A
TemporalAccessorrepresents some form of date and time information. This factory converts the arbitrary temporal object to an instance ofLocalTime.The conversion uses the
TemporalQueries#localTime()query, which relies on extracting theNANO_OF_DAYfield.This method matches the signature of the functional interface
TemporalQueryallowing it to be used in queries via method reference,LocalTime::from.- temporal
the temporal object to convert, not null
- returns
the local time, not null
- Exceptions thrown
DateTimeExceptionif unable to convert to a { @code LocalTime}
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def now(clock: Clock): LocalTime
Obtains the current time from the specified clock.
Obtains the current time from the specified clock.
This will query the specified clock to obtain the current time. Using this method allows the use of an alternate clock for testing. The alternate clock may be introduced using
dependency injection.- clock
the clock to use, not null
- returns
the current time, not null
- def now(zone: ZoneId): LocalTime
Obtains the current time from the system clock in the specified time-zone.
Obtains the current time from the system clock in the specified time-zone.
This will query the
system clockto obtain the current time. Specifying the time-zone avoids dependence on the default time-zone.Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
- zone
the zone ID to use, not null
- returns
the current time using the system clock, not null
- def now: LocalTime
Obtains the current time from the system clock in the default time-zone.
Obtains the current time from the system clock in the default time-zone.
This will query the
system clockin the default time-zone to obtain the current time.Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
- returns
the current time using the system clock and default time-zone, not null
- def of(hour: Int, minute: Int, second: Int, nanoOfSecond: Int): LocalTime
Obtains an instance of
LocalTimefrom an hour, minute, second and nanosecond.Obtains an instance of
LocalTimefrom an hour, minute, second and nanosecond.This factory may return a cached value, but applications must not rely on this.
- hour
the hour-of-day to represent, from 0 to 23
- minute
the minute-of-hour to represent, from 0 to 59
- second
the second-of-minute to represent, from 0 to 59
- nanoOfSecond
the nano-of-second to represent, from 0 to 999,999,999
- returns
the local time, not null
- Exceptions thrown
DateTimeExceptionif the value of any field is out of range
- def of(hour: Int, minute: Int, second: Int): LocalTime
Obtains an instance of
LocalTimefrom an hour, minute and second.Obtains an instance of
LocalTimefrom an hour, minute and second.The nanosecond field will be set to zero by this factory method.
This factory may return a cached value, but applications must not rely on this.
- hour
the hour-of-day to represent, from 0 to 23
- minute
the minute-of-hour to represent, from 0 to 59
- second
the second-of-minute to represent, from 0 to 59
- returns
the local time, not null
- Exceptions thrown
DateTimeExceptionif the value of any field is out of range
- def of(hour: Int, minute: Int): LocalTime
Obtains an instance of
LocalTimefrom an hour and minute.Obtains an instance of
LocalTimefrom an hour and minute.The second and nanosecond fields will be set to zero by this factory method.
This factory may return a cached value, but applications must not rely on this.
- hour
the hour-of-day to represent, from 0 to 23
- minute
the minute-of-hour to represent, from 0 to 59
- returns
the local time, not null
- Exceptions thrown
DateTimeExceptionif the value of any field is out of range
- def ofNanoOfDay(nanoOfDay: Long): LocalTime
Obtains an instance of
LocalTimefrom a nanos-of-day value.Obtains an instance of
LocalTimefrom a nanos-of-day value.This factory may return a cached value, but applications must not rely on this.
- nanoOfDay
the nano of day, from { @code 0} to { @code 24 * 60 * 60 * 1,000,000,000 - 1}
- returns
the local time, not null
- Exceptions thrown
DateTimeExceptionif the nanos of day value is invalid
- def ofSecondOfDay(secondOfDay: Long): LocalTime
Obtains an instance of
LocalTimefrom a second-of-day value.Obtains an instance of
LocalTimefrom a second-of-day value.This factory may return a cached value, but applications must not rely on this.
- secondOfDay
the second-of-day, from { @code 0} to { @code 24 * 60 * 60 - 1}
- returns
the local time, not null
- Exceptions thrown
DateTimeExceptionif the second-of-day value is invalid
- def parse(text: CharSequence, formatter: DateTimeFormatter): LocalTime
Obtains an instance of
LocalTimefrom a text string using a specific formatter.Obtains an instance of
LocalTimefrom a text string using a specific formatter.The text is parsed using the formatter, returning a time.
- text
the text to parse, not null
- formatter
the formatter to use, not null
- returns
the parsed local time, not null
- Exceptions thrown
DateTimeParseExceptionif the text cannot be parsed
- def parse(text: CharSequence): LocalTime
Obtains an instance of
LocalTimefrom a text string such as10:15.Obtains an instance of
LocalTimefrom a text string such as10:15.The string must represent a valid time and is parsed using
org.threeten.bp.format.DateTimeFormatter#ISO_LOCAL_TIME.- text
the text to parse such as "10:15:30", not null
- returns
the parsed local time, not null
- Exceptions thrown
DateTimeParseExceptionif the text cannot be parsed
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()