#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
SYSTEMTIME stime;
GetLocalTime( &stime );
cout << stime.wYear;
return 0;
}
SYSTEMTIME 其实是个结构体,其具体成员如下:
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;