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

Open Source License

Declaration

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

Method Source Code

//package com.java2s;

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) {
        return createCalendar(year, month, date).getTime();
    }/*from  ww w .  j ava 2  s  .c o  m*/

    public static Date createDate(int year, int month, int date, int hour, int minute) {
        return createCalendar(year, month, date, hour, minute).getTime();
    }

    public static Date createDate(int year, int month, int date, int hour, int minute, int second) {
        return createCalendar(year, month, date, hour, minute, second).getTime();
    }

    public static Calendar createCalendar(int year, int month, int date) {
        GregorianCalendar calendar = new GregorianCalendar();
        calendar.set(year, month - 1, date);
        return calendar;
    }

    public static Calendar createCalendar(int year, int month, int date, int hour, int minute) {
        GregorianCalendar calendar = new GregorianCalendar();
        calendar.set(year, month - 1, date, hour, minute);
        return calendar;
    }

    public static Calendar createCalendar(int year, int month, int date, int hour, int minute, int second) {
        GregorianCalendar calendar = new GregorianCalendar();
        calendar.set(year, month - 1, date, hour, minute, second);
        return calendar;
    }
}

Related

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