Java Utililty Methods Day Offset

List of utility methods to do Day Offset

Description

The list of methods to do Day Offset are organized into topic(s).

Method

StringgetOffsetDayOffNow(int offset)
get Offset Day Off Now
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_MONTH, offset);
return new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(c.getTime());
intgetOffsetDays(String strDate, String strDate2, String pFormat)
get Offset Days
SimpleDateFormat fmt = new SimpleDateFormat(pFormat);
SimpleDateFormat fmt2 = new SimpleDateFormat(pFormat);
Date param_date1 = fmt.parse(strDate);
Date param_date2 = fmt2.parse(strDate2);
return getOffsetDays(param_date1, param_date2);