Java 8 – How to convert LocalTime to LocalDateTime ?

In this article, we will learn how to convert LocalTime to LocalDateTime by adding/combining date information using atDate() method of LocalTime provided in Java 1.8 version

For LocalDateTime to LocalTime conversion, read Java 8 – How to extract LocalDate and LocalTime from LocalDateTime ?

Convert LocalTime to LocalDateTime :

  • atDate(LocalDate) – This method combines invoking LocalTime with a provided LocalDate to create a LocalDateTime

package in.bench.resources.java8.localtime.examples;

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

public class ConvertLocalTimeToLocalDateTime {

	public static void main(String[] args) {

		// 1. get system time
		LocalTime localTime =;
		System.out.println("Current System Time is :- \n" + localTime);

		// 2. convert LocalTime to LocalDateTime using atDate() - add current system date
		LocalDateTime localDateTime = localTime.atDate(;
		System.out.print("\nConversion of LocalTime to LocalDateTime "
				+ "using atDate() is :- \n"
				+ localDateTime);


Current System Time is :- 

Conversion of LocalTime to LocalDateTime using atDate() is :- 

Related Articles:


Happy Coding !!
Happy Learning !!

Java 8 – How to convert LocalTime to an OffsetTime ?
Java 8 – How to convert LocalTime in different Format Style ?