得到系统时间

#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
    SYSTEMTIME stime;
    GetLocalTime( &stime );
    cout << stime.wYear;
    return 0;
}

SYSTEMTIME 实际上是个结构体,其具体成员以下:
  ios

typedef struct _SYSTEMTIME { 
WORD wYear; 
WORD wMonth; 
WORD wDayOfWeek; 
WORD wDay;
 WORD wHour; 
WORD wMinute; 
WORD wSecond; 
WORD wMilliseconds;
 } SYSTEMTIME;
相关文章
相关标签/搜索