Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

set local clock

 
Stacy Lee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In java...how can i change the local computer time...i mean "real computer".
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this the "real computer" in your thermostat, a Unix machine, a Mac machine, a Windows machine, a PalmPilot???
 
Stacy Lee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This worked in Win98:
Runtime.getRuntime().exec("start command /c time 16:45:00");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic