-
Setting the System Time
I am trying to write a piece of code that will set the system time (ie change the time on the PC clock). I need to know how to set it on both machines running Windows NT and on the Solaris platform. When I say time I mean change the full time and date. Can anyone help?
-
i cant help with solaris but on WinNT,
from the MSDN,
BOOL SetSystemTime(
CONST SYSTEMTIME *lpSystemTime // address of system time to set
);
typedef struct _SYSTEMTIME { // st
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds; // Specifies the current millisecond.
} SYSTEMTIME;
Members
wYear
Specifies the current year.
wMonth
Specifies the current month; January = 1, February = 2, and so on.
wDayOfWeek
Specifies the current day of the week; Sunday = 0, Monday = 1, and so on.
wDay
Specifies the current day of the month.
wHour
Specifies the current hour.
wMinute
Specifies the current minute.
wSecond
Specifies the current second.
wMilliseconds