Here you can find the source of resetHourMinuteSecond(Timestamp timestamp, int hour, int minute, int second)
public static Timestamp resetHourMinuteSecond(Timestamp timestamp, int hour, int minute, int second)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.util.Calendar; public class Main { public static Timestamp resetHourMinuteSecond(Timestamp timestamp, int hour, int minute, int second) { Calendar calendar = Calendar.getInstance(); calendar.setTime(timestamp);//from ww w . j a v a 2s. co m calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, minute); calendar.set(Calendar.SECOND, second); return new Timestamp(calendar.getTimeInMillis()); } }