I'm not sure what you mean exactly, if you need to run a piece of code every day (as soon as the computers date changes) then I might have an answer for you :)
The example is in C# but java is very similar so I'm sure you'll be able to translate it.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleTest
{
class Program
{
static System.Timers.Timer timer = new System.Timers.Timer(500);
static DateTime LastDateExecuted = DateTime.Now;
static void Main(string[] args)
{
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
timer.Start();
Console.ReadLine();
}
static void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (LastDateExecuted.Date != DateTime.Now.Date)
{
DoSomeWork();
LastDateExecuted = DateTime.Now.Date;
}
}
private static void DoSomeWork()
{
Console.WriteLine("The date changed");
}
}
}
Hope this helps you :thumbsup: