wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes set local clock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "set local clock" Watch "set local clock" New topic
Author

set local clock

Stacy Lee
Greenhorn

Joined: Jun 09, 2001
Posts: 12
In java...how can i change the local computer time...i mean "real computer".
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Is this the "real computer" in your thermostat, a Unix machine, a Mac machine, a Windows machine, a PalmPilot???


"JavaRanch, where the deer and the Certified play" - David O'Meara
Stacy Lee
Greenhorn

Joined: Jun 09, 2001
Posts: 12
someone tell me i can use dos command to set the computer date
here is code:
=====================================================
public class Test {
public static void main(String[] args) {
try {
Runtime.getRuntime().exec("start command /c date
07-12-01");
} catch (Exception e) {
e.printStackTrace();
}
}
}
====================================================
the code above can work fine...but only change the date...
how do u make it change to time...??
thanks
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
This worked in Win98:
Runtime.getRuntime().exec("start command /c time 16:45:00");
 
Consider Paul's rocket mass heater.
 
subject: set local clock
 
Similar Threads
remote applet
What was your first PC?
doubt in uddi
Using javascript in java
Worst Technical Book Ever?