Here you can find the source of parseDateString(String pattern, String dateString)
public static String parseDateString(String pattern, String dateString)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; public class Main { public static String parseDateString(String pattern, String dateString) { SimpleDateFormat df = new SimpleDateFormat(pattern); try {/*from w w w.j a v a 2 s.c o m*/ return df.format(df.parse(dateString)); } catch (java.text.ParseException e) { e.printStackTrace(); } return null; } }