Here you can find the source of toDate(Object o)
public static Date toDate(Object o)
//package com.java2s; //License from project: LGPL import java.sql.Timestamp; import java.util.Date; public class Main { public static Date toDate(Object o) { Date result = null;// ww w. j a v a 2s . c om if (o instanceof Timestamp) { result = o != null ? new Date(((Timestamp) o).getTime()) : null; } return result; } }