Obtaining a Date Object Given Date Criteria - Java Date Time

Java examples for Date Time:Local Date Time

Introduction

Invoke the LocalDate.of() method for the year, month, and day.

Demo Code

import java.time.LocalDate;
import java.time.Month;

public class Main {
    public static void main(String[] args) {
       newSpecifiedDate();//from w  ww. ja  va2s.co m
    }
     public static void newSpecifiedDate() {
        LocalDate date = LocalDate.of(2000, Month.NOVEMBER, 11);
        System.out.println("Date from specified date: " + date);
    }
}

Result


Related Tutorials