Here you can find the source of getCurrentDateWithMinutePrecision()
public static Timestamp getCurrentDateWithMinutePrecision()
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { /**//from w w w .ja v a2 s. com * Gets the current date with minute precision. * * @return the current date time with seconds and milliseconds rounded down */ public static Timestamp getCurrentDateWithMinutePrecision() { Calendar c = new GregorianCalendar(); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); Timestamp ts = new Timestamp(c.getTimeInMillis()); return ts; } }