Java tutorial
//package com.java2s; import java.sql.Timestamp; public class Main { public static java.util.Date sqlTimestampToDate(Timestamp t) { return t != null ? new java.util.Date(Math.round((double) t.getTime() + (double) t.getNanos() / 1000000D)) : null; } }