How to check whether current time satisfies the schedule?
807580Sep 8 2009 — edited Sep 8 2009I am working on a task, which is opposite of cron tab. My application is in groovy but can call all Java api. Can you please provide some pointers?
User is allowed to schedule a rule to be executed the way crontab gives the options. For example he wants the rule to be executed from Monday to Friday from 8 am to 5 pm.
I cans schedule in crontabe or Quartz. At run time I have to match, whether the current time satisfy the time condition entered by user.
I may have to store this information in the database the way we put in the cron. Eg. my tables will have following
Id|| Policy Id|| seconds|| minutes|| hours|| Day|| Date|| month|| year
1 || 5 || 1 || 1 || 8-17 || M-F||? || * ||*
Now while my code is getting executing, how can I match whether the current time matches the condition mentioned above.
Thanks in advance.