Here you can find the source of toTimestamp(long ts)
public static Timestamp toTimestamp(long ts)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; public class Main { public static Timestamp toTimestamp(long ts) { if (ts == 0) { // return new Timestamp(0); return null; }/*from w w w .j a va2 s . co m*/ if (String.valueOf(ts).length() == 10) { ts = ts * 1000; } return new Timestamp(ts); } }