Here you can find the source of getFormattedDateTime(String date, String dateFormat)
public static String getFormattedDateTime(String date, String dateFormat)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static String getFormattedDateTime(String date, String dateFormat) { try {/*from w ww . jav a 2 s . c o m*/ return new SimpleDateFormat(dateFormat) .format(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(date)); } catch (ParseException e) { return ""; } } }