LocalTime now(ZoneId zone)
gets the current time
from the system clock in the specified time-zone.
now
has the following syntax.
public static LocalTime now(ZoneId zone)
The following example shows how to use now
.
import java.time.LocalTime; import java.time.ZoneId; /*from w ww. ja va2s . c o m*/ public class Main { public static void main(String[] args) { LocalTime l = LocalTime.now(ZoneId.systemDefault()); System.out.println(l); } }
The code above generates the following result.