How to set system clock in java

J

Jonas Hei

It probably is a daft question - but please can anyone tell how to set
system date using the java api (by setting system date I mean the
computer's clock. For example, in win32 api SetSystemTime(const
SYSTEMTIME* lpSystemTime) would set the current datetime and in C
runtime library (at least on some linux) adjtime() would do so)
 
G

Gordon Beaton

It probably is a daft question - but please can anyone tell how to set
system date using the java api (by setting system date I mean the
computer's clock. For example, in win32 api SetSystemTime(const
SYSTEMTIME* lpSystemTime) would set the current datetime and in C
runtime library (at least on some linux) adjtime() would do so)

JNI. Define a native method to invoke the appropriate system function.

/gordon
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top