Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Timer

Posted on 2002-05-10
8
Medium Priority
?
221 Views
Last Modified: 2010-03-31
1. I want to schedule a process to run at 12 midnight everyday. How do I do that by using Timer object? Or is there any other way? Sample code will be much helpful.

2. I use Timer.schedule(TimerTask task, Date time) function, but having problem to define the Date parameter. ex. I want to run it on 2002/04/30,
Date time = new Date(102,4,30), this doesn't work.

Thank you!
0
Comment
Question by:cHEo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 7000695
Listening.
0
 

Author Comment

by:cHEo
ID: 7000708
where can I get some example for this topic in the web?
Providing URL will be great
0
 

Author Comment

by:cHEo
ID: 7000715
where can I get some example for this topic in the web?
Providing URL will be great
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:girionis
ID: 7000736
0
 

Author Comment

by:cHEo
ID: 7000745
where can I get some example for this topic in the web?
Providing URL will be great
0
 
LVL 4

Accepted Solution

by:
Neutron earned 150 total points
ID: 7000771
hi cHEo, :-)

Valid month-value for Date is 0..11, not 1..12
maybe that is why your task execution was not triggered.
[unless you are prepared to wait till the end of may ;)]
However, you should use Calendar instead of date, because the constructor you're using is deprecated.

You can take a look at:
http://java.sun.com/docs/books/tutorial/essential/threads/timer.html

Greetings,
    </ntr> :)
0
 
LVL 4

Expert Comment

by:Neutron
ID: 7000773
oops, girionis, sorry about that link O:-)
0
 
LVL 35

Expert Comment

by:girionis
ID: 7000817
 It's all right :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question