Create Date with day, month and year
import java.util.Calendar;
import java.util.Date;
public class Main {
public static Date create(int day, int month, int year) {
return create(day, month, year, 0, 0, 0);
}
public static Date create(int day, int month, int year, int hourofday,
int minute, int second) {
if (day == 0 && month == 0 && year == 0)
return null;
Calendar cal = Calendar.getInstance();
cal.set(year, month - 1, day, hourofday, minute, second);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
}