Here you can find the source of formatDate(Object obj)
public static String formatDate(Object obj)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; public class Main { public static String formatDate(Object obj) { if (obj == null) { return ""; }// w w w . j ava2 s .co m try { java.util.Date dateval = (java.util.Date) obj; SimpleDateFormat dateformat = new SimpleDateFormat("MM/dd/yyyy"); dateformat.setLenient(false); return dateformat.format(dateval); } catch (Exception e) { return "bad date in FormatUtils.formatDate: " + obj.toString() + " error: " + e.getMessage(); } } }