Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to check whether current time satisfies the schedule?

807580Sep 8 2009 — edited Sep 8 2009
I 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 can’s 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2009
Added on Sep 8 2009
1 comment
131 views