public Initialize(int seconds){ Timer timer = new Timer(); timer.schedule(new timerTask(), 0, 1*600000); } class timerTask extends TimerTask{ public void run(){ Date date = new Date(); try{ System.out.println(date); }catch (Exception e) { System.exit(0); } }