简体   繁体   中英

How to set task to run after a certain time in the day?

Right now I have a class that writes reservations for a resort into a .dat file

Each day I would like to automatically check them out if the current date is more than or equal their checkout date.

So if its 12:40 in the day, then the function would automatically check out anyone whose checkout date is today. If its 11:40, then no.

Im really hoping for a non-TimerTask implementation since this method is within another class and Im restricted to it.

I currently use the Calender Class for dates.

Do you want to auto-checkout if someone reserves after 12.00? Which means the "first customer after noon" is the trigger for the checkout? If not, you will have to use a timer of some sort.

If you have enough customers to use the customer-driven auto-checkout, it's just a matter of checking if it's after 12.00...?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM