Here you can find the source of getAdjustDayResetTime(Date date, int adjustAmount)
public static Date getAdjustDayResetTime(Date date, int adjustAmount)
//package com.java2s; /*/*w w w. j av a 2s .co m*/ * CommonUtil.java * * Copyright 2007 NHN Corp. All rights Reserved. * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.util.Calendar; import java.util.Date; public class Main { public static Date getAdjustDayResetTime(Date date, int adjustAmount) { if (date == null) { return null; } Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.add(Calendar.DATE, adjustAmount); return cal.getTime(); } }