Here you can find the source of getCalendarBySpecific(int year, int month, int date, int hour)
public static Calendar getCalendarBySpecific(int year, int month, int date, int hour)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static Calendar getCalendarBySpecific(int year, int month, int date, int hour) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month - 1); calendar.set(Calendar.DAY_OF_MONTH, date); calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar; }/*from w ww.ja v a 2 s . c o m*/ }