I have the code below that prints a text every day. However I would like it to print the text only on -- for example -- 8 o'clock in the morning.
String text = "Test";
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
System.out.println(text);
}
}, 0, 1000 * 60 * 60);
In my code, the print time depends on the time I run the code and the code of course does not consider the daylight saving time changes etc.