Here you can find the source of convertDateFormat(String sourceDate, String sourceDateFormat, String destDateFormat)
public static String convertDateFormat(String sourceDate, String sourceDateFormat, String destDateFormat) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String convertDateFormat(String sourceDate, String sourceDateFormat, String destDateFormat) throws ParseException { Calendar calendar = Calendar.getInstance(); calendar.setTime(new SimpleDateFormat(sourceDateFormat).parse(sourceDate)); String destDate = new SimpleDateFormat(destDateFormat).format(calendar.getTime()); return destDate; }/*from ww w .j a v a 2 s . c om*/ }