Java LocalDate create from LocalDateTime

Description

Java LocalDate create from LocalDateTime


import java.time.LocalDate;
import java.time.LocalDateTime;

public class Main {
  public static void main(String[] args) {
    LocalDateTime  localDateTime = LocalDateTime.of(2015, 6,  21,  13, 40);
    System.out.println(localDateTime);
    //from w w  w.  java2 s.  c  o m
    LocalDate localDate  = LocalDate.from(localDateTime);
    System.out.println(localDate);
  }
}



PreviousNext

Related