public static String formatDateTime(java.util.Date date,String format,String locale,String timeZone){
  SimpleDateFormat dateFormat=getDateFormat(format,locale,timeZone);
synchronized (dateFormat) {
    return dateFormat.format(date);
  }
}

public static String formatDateTime ( java . util . Date date , String format , String locale , String timeZone ) { SimpleDateFormat dateFormat = getDateFormat ( format , locale , timeZone ) ; synchronized ( dateFormat ) { return dateFormat . format ( date ) ; } }
formats a date using a format string .
