Here you can find the source of objectToDate(Object Obj)
public static Date objectToDate(Object Obj)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date objectToDate(Object Obj) { SimpleDateFormat formatoDelTexto = new SimpleDateFormat("yyyy-MM-dd"); Date aux = null;/*from w w w .j a v a 2 s . c o m*/ try { aux = formatoDelTexto.parse(objectToString(Obj)); } catch (Exception ex) { } return aux; } public static String objectToString(Object Obj) { String Str = ""; if (Obj != null) { Str = Obj.toString(); } return Str; } }