1.UTC: World Coordination Time
2.LOcalTime: local time, which is the current time of the system setting time zone;
3.SYSTEMTIME: GMT, minus time zone by local time, and localtime are stored with SYSTEMTIME structure;
4.FileTime: Based on UTC, is a value of a single bit, recording the number of seconds from 1609-01-01 00:00:00 to now, accurate to nanosecond;
5.time_t Timestamp: The value of a single bit, recording the number of seconds from 1970-01-01 00:00:00 to the present;
6.QDateTime is a combination of qdate and Qtime in Qt, providing a range of processing functions.
Several functions are used:
1. FILETIME converted to Systemtime:bool filetimetosystemtime (const FILETIME *lpfiletime, Lpsystemtime lpsystemtime);
FILETIME FILETIME;
SYSTEMTIME Systime;
FileTimeToSystemTime (&filetime, &systime);
Note: Two & must add, the first is to take the address, the second temporarily do not know why, but will not be reported can not be converted from systemtime to Lpsystemtime;
2.FILETIME converted into time_t, using intermediate variables Ularge_integer
FILETIME FILETIME;
Ularge_integer ull;
Ull. LowPart =filetime.dwlowdatetime;
Ull. Highpart = Filetime.dwhighdatetime;
time_t time_create= ull. Quadpart/10000000ull-11644473600ull;
3.SYSTEME is converted into string form, because there is no direct conversion function, can be converted to string form by Qdatetime;filetime, first converted to Systeme.
SYSTEMTIME Dircreatetime;
FILETIME FILETIME;
Expect_true (FileTimeToSystemTime (&filetime,&dircreatetime));
Qdatetime Qdatetime;
Qdatetime.setdate (Qdate (Dircreatetime.wyear, Dircreatetime.wmonth, Dircreatetime.wday));
Qdatetime.settime (Qtime (Dircreatetime.whour, Dircreatetime.wminute, Dircreatetime.wsecond));
QString format = "Yyyy-mm-dd hh:mm:ss";
QString str_time=qdatetime.tostring (format);
SYSTEMTIME, Fileitime, Locltime, UTC, Qdatetime and many other times