Here you can find the source of calendar(int year, int month, int date, int hourOfDay, int minute)
private static Calendar calendar(int year, int month, int date, int hourOfDay, int minute)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { private static Calendar calendar(int year, int month, int date, int hourOfDay, int minute) { final Calendar cal = Calendar.getInstance(); cal.setLenient(false);//from w ww . j a v a 2 s. c om cal.clear(); cal.set(year, month, date, hourOfDay, minute); return cal; } }