Here you can find the source of getDateObj(int year, int month, int day)
public static Date getDateObj(int year, int month, int day)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date getDateObj(int year, int month, int day) { Calendar c = new GregorianCalendar(); c.set(year, month - 1, day);//w w w.j a v a 2 s .c om return c.getTime(); } public static Date getDateObj(String argsDate, String split) { String[] temp = argsDate.split(split); int year = new Integer(temp[0]).intValue(); int month = new Integer(temp[1]).intValue(); int day = new Integer(temp[2]).intValue(); return getDateObj(year, month, day); } public static Date getDateObj() { Calendar c = new GregorianCalendar(); return c.getTime(); } }