Here you can find the source of getCurrentDate()
public static Timestamp getCurrentDate()
//package com.java2s; //License from project: Apache License 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);// ww w . j ava 2s . co m return t; } }