Here you can find the source of resetHourMinSecMill(final Date date)
Parameter | Description |
---|---|
date | the date |
public static Date resetHourMinSecMill(final Date date)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**//from www .j av a 2s .c om * Reset hours, minutes, seconds and milliseconds * * @param date the date * @return the date with reseted field */ public static Date resetHourMinSecMill(final Date date) { final int hourOfDay = 17; final Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.set(Calendar.HOUR_OF_DAY, hourOfDay); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); } }