LocalTime now(clock) method in Java with Examples Last Updated : 12 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The now(Clock clock) method of the LocalTime class in Java is used to get the current time from the specified clock. Syntax: 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: Program 1: Java // Java program to demonstrate // LocalTime.now(Clock clock) method import java.time.*; import java.time.temporal.*; public class GFG { public static void main(String[] args) { // apply now(Clock clock) method // of LocalTime class LocalTime time = LocalTime.now( Clock.systemUTC()); // print time System.out.println("Time: " + time); } } Output: Time: 21:04:28.811 Program 2: Java // Java program to demonstrate // LocalTime.now(Clock clock) method import java.time.*; import java.time.temporal.*; public class GFG { public static void main(String[] args) { // apply now(Clock clock) method // of LocalTime class LocalTime time = LocalTime.now( Clock.systemUTC()); // print time System.out.println("Time: " + time); } } Output: Time: 21:05:21.192 Above two examples are taken to show the variance in result for same program according to time progression. References: https://docs.oracle.com/javase/10/docs/api/java/time/LocalTime.html#now(java.time.Clock) Comment More infoAdvertise with us Next Article LocalDate now() Method in Java with Examples P pp_pankaj Follow Improve Article Tags : Java Java-Functions Java-LocalTime Practice Tags : Java Similar Reads LocalTime now() method in Java with Examples The now() method of the LocalTime class in Java is used to get the current time from the system clock in the default time-zone. Syntax: public static LocalTime now() Parameters: This method does not accept any parameter. Return value: This method returns the current time using the system clock and d 1 min read LocalTime of() method in Java with Examples The of(int hour, int minute) method of the LocalTime class in Java is used to create an instance of LocalTime from the passed values of hour and minute. In this method, the hour and minute are passed in the Integer format and it returns time-based on these values. The values of second and nanosecond 4 min read LocalDate now() Method in Java with Examples In LocalDate class, there are three types of now() method depending upon the parameters passed to it. now() now() method of a LocalDate class used to obtain the current date from the system clock in the default time-zone.This method will return LocalDate based on system clock with default time-zone 2 min read LocalDateTime now() Method in Java with Examples In LocalDateTime class, there are three types of now() method depending upon the parameters passed to it. now() now() method of a LocalDateTime class used to obtain the current date-time from the system clock in the default time-zone.This method will return LocalDateTime based on system clock with d 2 min read LocalTime with() Method in Java with Examples In LocalTime class, there are two types of with() method depending upon the parameters passed to it. with(TemporalAdjuster adjuster) with(TemporalAdjuster adjuster) method of the LocalTime class used to adjusted this time using TemporalAdjuster and after adjustment returns the copy of adjusted time. 3 min read LocalTime now(ZoneId) method in Java with Examples The now(ZoneId zone) method of the LocalTime class in Java is used to get the current time from the system clock in the specified time-zone. Syntax: public static LocalTime now(ZoneId zone) Parameters: This method accepts ZoneId as parameter. Return value: This method returns the current time using 1 min read Like