@Test public void testDateFromNow(){ int days = 2; int hours = 3; int minutes = 50; Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, days); cal.add(Calendar.HOUR, hours); cal.add(Calendar.MINUTE, minutes); Date expectedDate = cal.getTime(); Date actualDate = dateUtil.getDateFromNow(days, hours, minutes); Assert.assertEquals(expectedDate.getYear(), actualDate.getYear()); Assert.assertEquals(expectedDate.getDay(), actualDate.getDay()); Assert.assertEquals(expectedDate.getMonth(), actualDate.getMonth()); }
public Date getDateFromNow(int days) { return getDateFromNow(days, 0, 0); }
DateUtil { public Date getDateFromNow(int days) { return getDateFromNow(days, 0, 0); } }
DateUtil { public Date getDateFromNow(int days) { return getDateFromNow(days, 0, 0); }  }
DateUtil { public Date getDateFromNow(int days) { return getDateFromNow(days, 0, 0); }  Date getDateFromNow(int days); Date getDateFromNow(int days, int hours, int minutes); static String dateToString(Date date, String dateFromat); Date getDateFromGivenDate(Date date, int days, int hours,int minutes, int second); Date addTimeOffset(Date date, int mins); static Date getUTCDate(); static Date getUTCDate(long epoh); static Date getLocalDateForUTCDate(Date date); static Date stringToDate(String dateString, String dateFromat); }
DateUtil { public Date getDateFromNow(int days) { return getDateFromNow(days, 0, 0); }  Date getDateFromNow(int days); Date getDateFromNow(int days, int hours, int minutes); static String dateToString(Date date, String dateFromat); Date getDateFromGivenDate(Date date, int days, int hours,int minutes, int second); Date addTimeOffset(Date date, int mins); static Date getUTCDate(); static Date getUTCDate(long epoh); static Date getLocalDateForUTCDate(Date date); static Date stringToDate(String dateString, String dateFromat);  }