LocalTime atDate(LocalDate date) example
Description
LocalTime atDate(LocalDate date)
combines this time with a date
to create a LocalDateTime.
Syntax
atDate
has the following syntax.
public LocalDateTime atDate(LocalDate date)
Example
The following example shows how to use atDate
.
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
/*from w ww. j av a2 s .co 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.