"Jimmy" <ji*****@iwow.com.sg> wrote in message
news:bl**********@mawar.singnet.com.sg...
Hello,
Can anyone tell me how to set the time using C code?
There is no way. C does not require the host platform
to have a clock at all.
After browsing through
MSDN,
MSDN does not define or document the C language, but
Microsoft products.
I only find the C command
C has no commands.
to get time and not set time. Can anyone
advise me on this??
The C standard library provides a function called
'time()' which can retrieve a system clock's time
*if* such a system clock exists. There is no
C function which can alter the state of a system's
clock.
You'll need platform-specific tools. You mention MSDN.
If you're wanting to do this on a Windows system, then
yes, there are indeed Microsoft functions for accessing
and modifying the state of the system clock.
But platform specific issues are not topical here.
The answer is indeed there at the MSDN site, all
you have to do is look. It's also described in the
documentation of the Windows API, provided with
virtually all Windows compilers.
-Mike