LocalDate now(Clock clock) example
Description
LocalDate now(Clock clock)
creates the current date from the specified clock.
Syntax
now
has the following syntax.
public static LocalDate now(Clock clock)
Example
The following example shows how to use now
.
import java.time.Clock;
import java.time.LocalDate;
/* www. java2 s .c om*/
public class Main {
public static void main(String[] args) {
LocalDate a = LocalDate.now(Clock.systemDefaultZone());
System.out.println(a);
}
}
The code above generates the following result.