UTC: Coordinated Universal Time.
GMT: Greenwich Mean Time.
FILETIME:
LOCALTIME:
SYSTEMTIME:
SYSTEMTIME structure. The time is either in coordinated universal time (UTC) or local time, depending on the function that is being called.
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth; // based on 1(Jan)
WORD wDayOfWeek; // 0 for sunday, 1 for monday, … 6 for saturday
WORD wDay; // based on 1
WORD wHour; // from 0 to 23
WORD wMinute; // from 0 to 59
WORD wSecond; // from 0 to 59
WORD wMilliseconds; // from 0 to 999
} SYSTEMTIME;
typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME, FAR *LPFILETIME;
typedef union _ULARGE_INTEGER {
struct {
DWORD LowPart;
DWORD HighPart;
};
struct {
DWORD LowPart;
DWORD HighPart;
} u;
ULONGLONG QuadPart;
} ULARGE_INTEGER,
*PULARGE_INTEGER;
time_t (__int64 or long integer)
struct tm {
int tm_sec; // from 0 to 59
int tm_min; // from 0 to 59
int tm_hour; // from 0 to 23
int tm_mday; // from 1 to 31
int tm_mon; // from 0 to 11
int tm_year; // Indicates the number of years since 1900.
int tm_wday; // 0 for sunday, 6 for saturday
int tm_yday; // from 0 to 365
int tm_isdst;
};
From total seconds (clocks) to tm structure for local time, lval is the variable for total seconds.
time_t t(lval);
struct tm * pltm = localtime((const time_t*)&t);
time_t t(lval);
struct tm * pgtm = gmtime((const time_t*)&t);
cout<<asctime((const tm*)pgtm);
time_t _t = mktime(pltm);