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(t.getTime() + t.getNanos() / 1000000D)) : null; } }