Here you can find the source of toTimestamp(Object objInParam)
public static Timestamp toTimestamp(Object objInParam)
//package com.java2s; /*// w w w . ja v a 2 s .c om Pulsar Copyright (C) 2013-2015 eBay Software Foundation Licensed under the GPL v2 license. See LICENSE for full terms. */ import java.sql.Timestamp; import java.util.Date; public class Main { public static Timestamp toTimestamp(Object objInParam) { Timestamp ts = null; if (objInParam instanceof Timestamp) ts = (Timestamp) objInParam; else if (objInParam instanceof Number) ts = new Timestamp(((Number) objInParam).longValue()); else if (objInParam instanceof Date) ts = new Timestamp(((Date) objInParam).getTime()); else if (objInParam instanceof String) { if ("now".equalsIgnoreCase((String) objInParam)) ts = new Timestamp(System.currentTimeMillis()); else ts = Timestamp.valueOf((String) objInParam); } else if (objInParam == null) ts = new Timestamp(System.currentTimeMillis()); return ts; } }