I have an application that needs to do some actions every date change say at midnight. Whenever the date changes the application should be said of the same. Any help regarding how to implement the functionality would be appreciated.
What you're looking for is a scheduler. Quartz is probably the most commonly used scheduler in the Java world, though Spring has some interesting scheduling features if you are already using that framework.
Whichever scheduler you choose, you generally specify an action to occur (sometimes referred to as a "job") and a time for it to happen (a "trigger" in the Quartz terminology). In your case you'd set the trigger to run every day at midnight, and when it fired it would do whatever it was you needed done, as specified by your job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With