Here you can find the source of strDateConvertToDate(String strDate, String fFormatStr)
public static Date strDateConvertToDate(String strDate, String fFormatStr)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.util.Date; public class Main { public static Date strDateConvertToDate(String strDate, String fFormatStr) { java.util.Date birthday = new java.util.Date(); java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(fFormatStr); try {/*from w w w . j a va 2s . com*/ birthday = sdf.parse(strDate); return birthday; } catch (ParseException e) { e.printStackTrace(); return null; } } }