Qt设置系统时间

标签:
杂谈 |
大家都知道Qt中有QDateTime等有关时间与日期的类,类中包含很多成员函数,可以很方便的实现有关时间与日期的操作,比如:想要获得系统当前的时间与日期,可以调用currentDateTime();
常用的与时间有关的Win32 API有两个:GetSystemTime();
VOID GetSystemTime(LPSYSTEMTIME lpSystemTime);
BOOLSetSystemTime( const SYSTEMTIME *lpSystemTime );
BOOL
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
}SYSTEMTIME, *PSYSTEMTIME;
}
10
11
12
14
15
16
17
18
19
21
23
24
25
26
27
28
29