aspose file tools
The moose likes Beginning Java and the fly likes set local clock Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply 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");
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: set local clock
 
Similar Threads
What was your first PC?
doubt in uddi
Using javascript in java
Worst Technical Book Ever?
remote applet