我想计算到达下一个Cron Job时间还剩多少分钟。
//Cron Job data from sql timer list elements
//first
TimerMinute = "*"
TimerHour = "*/12"
TimerDay = "*"
TimerMonth = "*"
TimerWeekDay = "*"
//second
TimerMinute = "30"
TimerHour = "8-18"
TimerDay = "29"
TimerMonth = "10"
TimerWeekDay = "*"
calculate(list[0]);
calculate(list[1]);
public void calculateAndRun(string[] list)
{
//needed code
callThisMethodWhenYouNeedToCall();
callThisMethodIfElementHaveInterval();
//if need more method can be use every skils of cron job
}
第一个元素每12小时调用一次该方法
callThisMethodWhenYouNeedToCall();
第二个元素每29。10月8:30调用此方法
callThisMethodWhenYouNeedToCall();
和第二个元素在时间18:30到10月29日调用此方法
callThisMethodIfElementHaveInterval();