獲取系統時間精確到毫秒級C++代碼實現

#include <windows.h>//必須包此頭文件
#include<iostream>
using namespace std;
int main()
{
    SYSTEMTIME t;
    GetLocalTime(&t);
    cout << t.wYear << "年" << t.wMonth << "月" << t.wDay << "日" //就是毫秒數
    << t.wHour << ":" << t.wMinute << ":" << t.wSecond << ":" << t.wMilliseconds << endl;

    return 0;
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章