logo image

Java program to print present date



Following program shows you how to print present date. We can get present date using LocalDate.now() in java.

import java.time.LocalDate;

public class Basic16 {

	public static void main(String[] args) {

		LocalDate presentDate = LocalDate.now();

		System.out.println("Present Date is: " + presentDate);

	}

}

Output:

Present Date is: 2018-03-19