c# - Create cron Expression from 8:30 to 12:30 -
i want create cron run 8:30 12:30 every 1 minute in mon,tue,wed,sat,sun.
i create expression:
0 30/1 8-12 ? * mon,tue,wed,thu,sun *
but not work me.
you should use multiple cron expressions instead of one. try this:
0 30-59 8 ? * mon-wed,sat,sun * // 8:30 - 8:59 0 * 9-11 ? * mon-wed,sat,sun * // 9:00 - 11:59 0 0-30 12 ? * mon-wed,sat,sun * // 12:00 - 12:30
please note year field isn't mandatory, can omit last field, this:
0 30-59 8 ? * mon-wed,sat,sun // 8:30 - 8:59 0 * 9-11 ? * mon-wed,sat,sun // 9:00 - 11:59 0 0-30 12 ? * mon-wed,sat,sun // 12:00 - 12:30
good luck!
Comments
Post a Comment