2009年8月11日 星期二

Quartz - 時間設定範例

 
Seconds 0-59 , - * /
Minutes 0-59 , - * /
Hours 0-23 , - * /
Day-of-month 1-31 , - * ? / L W
Month 1-12 or JAN-DEC , - * /
Day-of-Week 1-7 or SUN-SAT , - * ? / L #
Year (Optional) empty, 1970-2099 , - * /

'?' - It is used to specify 'no specific value'. (used in Day-of-month, Day-of-Week only)
This is useful when you need to specify something in one of the two fields, but not the other.


以上是官方文件

範例:感謝小胖提供XD

1.每5秒
/5 * * * *
2.每5分
* /5 * * *



未完...

2 意見:

天空不作美 提到...

todd A...我小修正一下唷, 你的秒打錯囉.
1.每5秒
* /5 * * * <-- 秒是第一個
----------------改為
1.每5秒
/5 * * * *

Todd 提到...

呵~直接改就行壓XD