Solved

Timer

Posted on 2002-05-10
8
216 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
  • 3
  • 3
  • 2
8 Comments
 
LVL 35

Expert Comment

by:girionis
Comment Utility
Listening.
0
 

Author Comment

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

Author Comment

by:cHEo
Comment Utility
where can I get some example for this topic in the web?
Providing URL will be great
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:cHEo
Comment Utility
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 50 total points
Comment Utility
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
Comment Utility
oops, girionis, sorry about that link O:-)
0
 
LVL 35

Expert Comment

by:girionis
Comment Utility
 It's all right :-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Java virtual machine monitoring tools 3 39
matchUp  challenge 9 70
java continue statement 10 69
word0 challenge 4 52
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now