2012-11-01 91 views

回答

4

它將在每天4:40,5:40,6:40,... 16:40運行。簡單的測試代碼:

import org.springframework.scheduling.support.CronSequenceGenerator; 


CronSequenceGenerator cron = new CronSequenceGenerator("0 40 4-16 * * *", TimeZone.getDefault()); 
Date d = new Date(); 
for (int i = 0; i < 20; ++i) { 
    d = cron.next(d); 
    System.out.println(d); 
} 

this石英晶API。

+0

感謝您的幫助 –