LocalTime
Explore how to use the Java 8 LocalTime class to represent and manage times without dates. Learn to create instances with now(), of(), and parse(), add time units, retrieve minutes, and compare times for before or after. This lesson equips you with practical skills in handling time efficiently using the Java Time API.
As per JavaDocs, “LocalTime is an immutable date-time object that represents a time, often viewed as hour-minute-second. Time is represented to nanosecond precision. For example, the value “13:45.30.123456789” can be stored in a LocalTime”.
In other words, the LocalTime represents time without a date.
An instance of LocalTime can be ...