Java Month of Year year(int month, int day, int hour, int minute, int second)

Here you can find the source of year(int month, int day, int hour, int minute, int second)

Description

year

License

Artistic License

Declaration

public static Date year(int month, int day, int hour, int minute, int second) 

Method Source Code


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

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

public class Main {
    public static Date year(int month, int day, int hour, int minute, int second) {
        Calendar now = now();/*from www . ja  va 2s .c o  m*/
        return new GregorianCalendar(now.get(Calendar.YEAR), month, day, hour, minute, second).getTime();
    }

    public static Calendar now() {
        Calendar now = new GregorianCalendar();
        now.setTimeInMillis(new Date().getTime());
        now.setTimeZone(TimeZone.getDefault());

        return now;
    }
}

Related

  1. monthLength(int month, int year)
  2. newInstance(int year, int month, int day)
  3. sleepUntil(int year, int month, int day, int hour, int min, int sec)
  4. stringToMonth(String year, String month, boolean flag)
  5. sumDayByYearMonth(int year, int month)
  6. yearMonth()