Java tutorial
//package com.java2s; import java.sql.Timestamp; import java.util.Calendar; public class Main { public static Timestamp getCurrentDate() { Calendar c = Calendar.getInstance(); c.set(c.get(1), c.get(2), c.get(5), 0, 0, 0); Timestamp t = new Timestamp(c.getTime().getTime()); t.setNanos(0); return t; } }