user1301587
user1301587

Reputation: 455

Cron Expression to execute cron triggers on every week at 3 pm and start date from 25th April 2012

I am in need to create a cron triggers expression which should fire on every week at 3 pm and start date from 25th April 2012.

Please note i am using CronTriggerImpl and i want to use it in the C# DotNet.

Thanks in advance

Upvotes: 1

Views: 1192

Answers (1)

Kenned
Kenned

Reputation: 578

The expressions have the format

sec min hour DayOfMonth Month DayOfWeek Year

so with 3 expressions you should be able to get what you want.

0 0 3 25-30 4   0 2012    
0 0 3 *   5-12  0 2012
0 0 3 *   *   0 2013-2099

Line 1 says: 3 pm on first day of week on day of month larger-or-equal to 25th in april month in year 2012

Line 2 says: 3 pm on first day of week on any day of month in months largeror-equal to may in year 2012

Line 3 says: 3 pm on first day of week on any day of month in any month in year larger-or-equal to 2013.

Otherwise just use the simple expression

0 0 3 * * 0 *

combined with

newTrigger().startAt(new DateTime("2012-04-25"))

Disclaimer: I've not actually tried this. :)

Edit: I'm not sure quartz likes open ranges... so they're closed now.

Upvotes: 1

Related Questions