Here you can find the source of asDate(Object tsObj)
private static Timestamp asDate(Object tsObj)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; public class Main { private static Timestamp asDate(Object tsObj) { if (tsObj != null) { long tsLong = (tsObj instanceof Number) ? ((Number) tsObj).longValue() : Long.parseLong(tsObj.toString()); return new Timestamp(tsLong); }//from ww w . j ava 2 s. co m return null; } }