Java Month of Year newInstance(int year, int month, int day)

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

Description

new Instance

License

Apache License

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    static public Date newInstance(int year, int month, int day) {
        return newInstance(year, month, day, 0, 0, 0, 0);
    }/*ww w  . j  av  a  2  s .  co m*/

    static public Date newInstance(int year, int month, int day, int hour, int minute) {
        return newInstance(year, month, day, hour, minute, 0, 0);
    }

    static public Date newInstance(int year, int month, int day, int hour, int minute, int second) {
        return newInstance(year, month, day, hour, minute, second, 0);
    }

    static public Date newInstance(int year, int month, int day, int hour, int minute, int second, int misecond) {
        Calendar c = Calendar.getInstance();
        c.set(year, month, day, hour, minute, second);
        c.set(Calendar.MILLISECOND, misecond);
        return c.getTime();
    }
}

Related

  1. getWorkDayNum(int year, int month, int start, int end)
  2. isDefaultHolidays(int year, int month, int day)
  3. isWeekEnd(int year, int month, int day)
  4. Month_Of_Year(String Date, int MonthCase)
  5. monthLength(int month, int year)
  6. sleepUntil(int year, int month, int day, int hour, int min, int sec)
  7. stringToMonth(String year, String month, boolean flag)
  8. sumDayByYearMonth(int year, int month)
  9. year(int month, int day, int hour, int minute, int second)