LocalTime atDate(LocalDate date)
combines this time with a date
to create a LocalDateTime.
atDate
has the following syntax.
public LocalDateTime atDate(LocalDate date)
The following example shows how to use atDate
.
import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; //from w w w.j av a2 s .c o m public class Main { public static void main(String[] args) { LocalTime l = LocalTime.now(); LocalDateTime t = l.atDate(LocalDate.now()); System.out.println(t); } }
The code above generates the following result.