Java tutorial
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String date, String pattern) { Date result = null; SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); try { result = dateFormat.parse(date); } catch (Exception e) { e.printStackTrace(); } return result; } }