Java LocalDate create from system default Clock

Description

Java LocalDate create from system default Clock

import java.time.Clock;
import java.time.LocalDate;

public class Main {
   public static void main(String[] args) {
      Clock clock = Clock.systemDefaultZone();
      // Get the local date using the clock
      LocalDate ld = LocalDate.now(clock);
      System.out.println(ld);// ww w.  j  av a2 s . c  o m

   }
}



PreviousNext

Related