Tuesday, July 2, 2013
C++: How to show system time and date in Windows
The SYSTEMTIME structure has the following members: wYear, wMonth,wDay, wDayOfWeek,wHour, wMinute,wSecond,wMilliseconds. All members are of type WORD.
The GetLocalTime() function has only one parameter. That is-- pointer to SYSTEMTIME structure. When this function is called, it sets the values to corresponding members. Then we can output them.
The following code shows how we can show running system time, date in the console.