Here you can find the source of strToDate(final String str)
public static final Date strToDate(final String str)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH); public static final Date strToDate(final String str) { try {/*from w ww.j a v a 2 s .co m*/ return DATE_FORMAT.parse(str); } catch (ParseException e) { throw new RuntimeException(e.getMessage() + " Caused by " + e.getCause(), e); } } }