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

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

Description

create Date

License

LGPL

Declaration

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

Method Source Code

//package com.java2s;
/*//w w  w  . j  a va 2 s.c o m
* Distributable under LGPL v3 license.
* See terms of license at https://github.com/Yunfeng/schotel/blob/master/LICENSE
*/

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

public class Main {

    public static Date createDate(int year, int month, int date) {
        GregorianCalendar calendar = new GregorianCalendar();
        calendar.clear();
        calendar.set(Calendar.YEAR, year);
        calendar.set(Calendar.MONTH, month - 1);
        calendar.set(Calendar.DAY_OF_MONTH, date);
        return calendar.getTime();
    }
}

Related

  1. createDate(final int month, final int day, final int year)
  2. createDate(final int year, final int month, final int day, final int hour, final int minute, final int second, final int millisecond)
  3. createDate(final int yyyy, final int month, final int day)
  4. createDate(int month, int day)
  5. createDate(int year, int month, int date)
  6. createDate(int year, int month, int date)
  7. createDate(int year, int month, int date)
  8. createDate(int year, int month, int day)
  9. createDate(int year, int month, int day)