Java Clock convert to LocalDate

Description

Java Clock convert to LocalDate

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

public class Main {
  public static void main(String[] args) {
     Clock clock = Clock.systemDefaultZone();
     System.out.println(clock);//from  www  .  j  a  v a 2  s .  c o m

     LocalDate localDate = LocalDate.now(clock);
     System.out.println(localDate);
  }

}



PreviousNext

Related