Java LocalDate at day start local time

Description

Java LocalDate at day start local time

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

public class Main {
  public static void main(String[] args) {
    LocalDate ld = LocalDate.of(2020, 5, 2);  // 2020-05-02
    System.out.println(ld);/* w  w  w. j a  va 2  s . c  o m*/

    LocalDateTime ldt1 = ld.atStartOfDay();   // 2020-05-02T00:00
    System.out.println(ldt1);
  }
}



PreviousNext

Related