java.time.LocalTime.atDate() 方法示例


java.time.LocalTime.atDate() 方法示例

package com.codingdict;

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

public class LocalTimeDemo {
   public static void main(String[] args) {

      LocalDate date = LocalDate.now();
      System.out.println(date);  

      LocalTime time = LocalTime.parse("12:30:30");
      LocalDateTime datetime = time.atDate(date);
      System.out.println(datetime);  
   }
}