Here you can find the source of parseDateString(String dateStr, String pattern)
public static Date parseDateString(String dateStr, String pattern)
//package com.java2s; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static Date parseDateString(String dateStr, String pattern) { return parseDateString(dateStr, pattern, Locale.getDefault()); }// w w w .j a v a 2s.c om public static Date parseDateString(String dateStr, String pattern, Locale locale) { SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale); return dateFormat.parse(dateStr, new ParsePosition(0)); } }