Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date stringToDate_yyyyMMdd(String aStrDate) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); try { if (aStrDate != null) return dateFormat.parse(aStrDate); } catch (java.text.ParseException ex) { return null; } return null; } }