Here you can find the source of getDateFromStr(String inputDate, String inputFormatStr)
public static Date getDateFromStr(String inputDate, String inputFormatStr)
//package com.java2s; /*//from ww w. j a v a2 s . c om * CommonUtil.java * * Copyright 2007 NHN Corp. All rights Reserved. * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.util.Date; public class Main { public static Date getDateFromStr(String inputDate, String inputFormatStr) { java.text.SimpleDateFormat formatterInput = new java.text.SimpleDateFormat(inputFormatStr); try { return formatterInput.parse(inputDate); } catch (Exception e) { e.printStackTrace(); } return null; } }