| Schedule times are expressed as a Calendar indicating some point in the cycle of the schedule plus one of the constants from the Calendar class indicating which field of the calendar varies. So a weekly schedule for reports at 10:03 AM on Tuesdays would have:
calendar.setTime(new Date(currentExecutionTimeInMillis))
calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);
calendar.set(Calendar.HOUR), 10);
calendar.set(Calendar.MINUTE), 3);
calendar.set(Calendar.SECOND), 0);
calendar.set(Calendar.MILLISECOND), 0);
vary = Calendar.WEEK
offset is expressed in minutes after the beginning of the period
assuming 31 day months.
HOURLY -- minute of the hour
DAILY -- minute of the day
WEEKLY -- minute of the week
MONTHLY -- minute of the month
|