Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getFetchDelayDate(Integer dateDelayMinutes) { Calendar c = Calendar.getInstance(); if (dateDelayMinutes > 0) { dateDelayMinutes = -dateDelayMinutes; } c.add(Calendar.MINUTE, dateDelayMinutes); return c.getTime(); } public static Date getFetchDelayDate(Date startDate, Integer dateDelayMinutes) { Calendar c = Calendar.getInstance(); c.setTime(startDate); if (dateDelayMinutes > 0) { dateDelayMinutes = -dateDelayMinutes; } c.add(Calendar.MINUTE, dateDelayMinutes); return c.getTime(); } }