GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing www.geeksforgeeks.org — java.time.LocalTime Class in Java - GeeksforGeeks java.time.LocalTime Class in JavaLast Updated : 4 Nov, 2026 The LocalTime class, available in the java.time package, represents a time without date and timezone. Introduced in Java 8, it is part of the modern Date-Time API and is used to store and manipulate time values such as meeting schedules, alarms, business hours, and event timings.
Declaration Of java.time.LocalTime Class
Approach
Example: Program to illustrate LocalTime Class
Output Local time value : 06:20:52.986897 Explanation: The LocalTime.now() method returns the current system time. The program creates a LocalTime object and prints the current time, including hours, minutes, seconds, and nanoseconds. Example: Program to illustrate LocalTime where plusMethod() is illustrated
Output Time : 08:34:59.135137 Explanation: The plusMinutes(120) method adds 120 minutes (2 hours) to the current time and returns a new LocalTime object. The original time remains unchanged because LocalTime is immutable. Advantages of LocalTimeThe LocalTime class provides a simple and reliable way to work with time without including date or time zone information.
Commonly Used Methods of LocalTime
Comment Explore | ||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |