Here you can find the source of toDateStr(Object o)
public static String toDateStr(Object o) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String toDateStr(Object o) throws ParseException { return o == null ? null : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((Date) o); }//ww w .j av a 2 s . c o m }