Java program to print present day

Views: 178   

Following program shows you how to print present day.
We can get present day using in java.

package basics;

import java.time.LocalDate;

public class Basic13 {

    public static void main(String[] args) {

        LocalDate presentDate =;
        int presentDay = presentDate.getDayOfMonth();

        System.out.println("Present day is: " + presentDay);




Present day is: 18
On By