467,878 Members | 1,289 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,878 developers. It's quick & easy.

i want to run this program at a specified date and time

Expand|Select|Wrap|Line Numbers
  1. import java.util.*;
  2. class Test2 extends TimerTask{    
  3.     public void run(){        System.out.println(System.currentTimeMillis());
  4.     }
  5. }
  6. public class Test {
  7.     public static void main(String args[]){                        Date date=new Date(2011,04,12,6,33,00);         
  8.         Timer timer=new Timer();
  9.     timer.schedule(new Test2(),date);
  10.     }
  11. }
// i want to run this program at a specified date and time
// How could i do it?
Apr 13 '11 #1
  • viewed: 2460
Share:
1 Reply
Dheeraj Joshi
Expert 1GB
If you want to run your Java program at specified time, you may use operating system tools like cron.
Apr 13 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Adrian Parker | last post: by
17 posts views Thread by Lapchien | last post: by
3 posts views Thread by gregmalenky | last post: by
1 post views Thread by GMK | last post: by
7 posts views Thread by Jerome | last post: by
3 posts views Thread by fong.yang | last post: by
3 posts views Thread by Darhl Thomason | last post: by
7 posts views Thread by wanwan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.