Java LocalDate at local time

Description

Java LocalDate at 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);/*from w w  w  .  j  ava2  s. c o  m*/
      LocalDateTime ldt2 = ld.atTime(15, 30); // 2020-05-02T15:30
      System.out.println(ldt2);
   }
}



PreviousNext

Related