Java tutorial
//package com.java2s; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date getDate(String dateString) { DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); try { return format.parse(dateString); } catch (ParseException e) { throw new RuntimeException(e); } } }