Java Date Create createDate(int year, int month, int day)

Here you can find the source of createDate(int year, int month, int day)

Description

Creates the date.

License

Open Source License

Parameter

Parameter Description
year the year
month the month
day the day

Return

the date

Declaration

public static Date createDate(int year, int month, int day) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    /** Creates the date.
      */*from   w w w  .j  av a 2 s  .  com*/
      * @param year
      *            the year
      * @param month
      *            the month
      * @param day
      *            the day
      * @return the date
      */
    public static Date createDate(int year, int month, int day) {
        Calendar cal = Calendar.getInstance();
        cal.set(year, month, day, 0, 0, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }
}

Related

  1. createDate(int year, int month, int date)
  2. createDate(int year, int month, int date)
  3. createDate(int year, int month, int date)
  4. createDate(int year, int month, int date)
  5. createDate(int year, int month, int day)
  6. createDate(int year, int month, int day)
  7. createDate(int year, int month, int day)
  8. createDate(int year, int month, int day)
  9. createDate(int year, int month, int day)