title: Execute code when system time reaches a specific time
body: <p>How can i implement code to do something when a specific system time is reached?
  The only solution i have thought of is using a timer to "tick" every few minutes or hours to check if the specific time has been reached.</p>
  
  <p>Are there any other better solutions ?</p>
  
  <p>Thanks.</p>
  
  <p>sorry if i had not been clear, i would be implementing the code inside my Java program, it is to clear records of a log before a new day is coming and save the records.</p>
  
  <p><strong>Example:</strong> Clear the current records and save these records at 23:59.</p>