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;
} 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
Specifies the current millisecond.
.
the program is here!!
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TSystemTime *lpSystemTime = new TSystemTime;
try{
lpSystemTime->wYear = 1994;
lpSystemTime->wMonth = 1;
lpSystemTime->wDayOfWeek = 1;
lpSystemTime->wDay = 1;
lpSystemTime->wHour = 12;
lpSystemTime->wMinute = 10;
lpSystemTime->wSecond = 10;
lpSystemTime->wMilliseconds = 10;*/
if (!SetSystemTime(lpSystemTime))
ShowMessage("error");
}
catch(Exception &E) {
ShowMessage(E.Message);
return;
}
delete lpSystemTime;
}