Here you can find the source of parseDate(String actual, DateFormat format, Pattern pattern)
public static Date parseDate(String actual, DateFormat format, Pattern pattern)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static Date parseDate(String actual, DateFormat format, Pattern pattern) { Matcher m = pattern.matcher(actual); m.find();/*from www. j a v a 2 s .c om*/ try { return format.parse(m.group(1)); } catch (ParseException e) { throw new RuntimeException(e); } } }