Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { static Date createDate(int _Year, int _Month, int _Day) { String date = String.valueOf(_Year) + "-" + String.valueOf(_Month) + "-" + String.valueOf(_Day); return toDate(date); } static Date toDate(String _Input) { try { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); return dateFormat.parse(_Input); } catch (ParseException e) { e.printStackTrace(); } return null; } }