Setting the System Time.

K

Ken Adams

How do you go about setting your systems time from within a java app? I
found tonnes of documentation on getting the time, but surely there must be
a way to set it as well.

Thanks

Ken A
 
R

Rhino

Ken Adams said:
How do you go about setting your systems time from within a java app? I
found tonnes of documentation on getting the time, but surely there must be
a way to set it as well.

Thanks

Ken A
If I'm not mistaken, Java (or the JVM) gets the system time from your
operating system. If you set the clock with your standard OS facilities,
like the GUI in Windows, you should be able to set the clock to whatever
time you want.

Or are you determined to set the clock with Java? I'm not certain but I
don't think you can do that. Unless perhaps you use Runtime.exec() to
simulate setting the clock via the operating system.....

Rhino
 
A

Alun Harford

Ken Adams said:
How do you go about setting your systems time from within a java app? I
found tonnes of documentation on getting the time, but surely there must be
a way to set it as well.

Native method.

Alun Harford
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top