Here you can find the source of makeDate(int day, int month, int year, int hour, int min, int sec)
public static Date makeDate(int day, int month, int year, int hour, int min, int sec) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date makeDate(int day, int month, int year, int hour, int min, int sec) throws ParseException { DateFormat df1 = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); String sdate = day + "-" + month + "-" + year + " " + hour + ":" + min + ":" + sec; Date date = df1.parse(sdate); // System.out.println(sdate); // System.out.println(date.toString()); return date; }// w ww . j ava 2s.com public static Date makeDate(int[] dayMonthYearHourMinuteSecond) throws ParseException { return makeDate(dayMonthYearHourMinuteSecond[0], dayMonthYearHourMinuteSecond[1], dayMonthYearHourMinuteSecond[2], dayMonthYearHourMinuteSecond[3], dayMonthYearHourMinuteSecond[4], dayMonthYearHourMinuteSecond[5]); } }