Sujeet
Sujeet

Reputation: 143

Quartz Document and Wiki - Contradict on Cron Expression for Day of Month field

Here in wiki

http://en.wikipedia.org/wiki/CRON_expression#CRON_expression

under subheading "Predefined scheduling definitions"

Its mentioned that "day of week (0 - 7) (0 or 7 are Sunday, or use names)"

its referring 0 or 7 as Sunday

and under subheading "CRON expression"

its referring "the last Friday" ("5L") of a given month. In the day-of-month field,

but the Quartz Documentation

here http://quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/crontrigger

Contradicts things its saying

"Day of week 1-7 or SUN-SAT" (its not from 0-7 as mentioned in wiki)

and in the Special Characters subheading

its referring "6L" means "the last friday of the month" (In wiki its 5L)

So my question is

  1. Which one is correct ?
  2. Are both of these are correct in their own context ? (meaning quartz for only quartz and in wiki for unix based os)

Upvotes: 3

Views: 411

Answers (1)

darrenmc
darrenmc

Reputation: 1781

Yes both are correct. The wikipedia article refers to cron as implemented in Unix and its derivatives.

The Quartz Scheduler has it's own "cron like" implementation which is not fully compatible.

I would use the day of week names in your expression to avoid any confusion.

Upvotes: 4

Related Questions