LocalTime now(clock) method in Java with Examples
The now(Clock clock) method of the LocalTime class in Java is used to get the current time from the specified clock.
public static LocalTime now( Clock clock)
Parameters: This method accepts clock as parameter which represents the clock to use.
Return value: This method returns the current time.
Below programs illustrate the now(Clock clock) method of LocalTime in Java:
Above two examples are taken to show the variance in result for same program according to time progression.