C++获取当前系统时间,精确到毫秒

#include<iostream>
#include<windows.h>
#include<time.h>
using namespace std;
int main () 
{
	SYSTEMTIME lpsystime;
	GetLocalTime(&lpsystime);
	cout<<lpsystime.wYear<<"年"<<lpsystime.wMonth<<"月"<<lpsystime.wDay<<"日 星期"<<lpsystime.wDayOfWeek<<" "<<lpsystime.wHour<<"点"<<lpsystime.wMinute<<"分"<<lpsystime.wSecond<<"秒"<<lpsystime.wMilliseconds<<"毫秒"<<endl;
	return 0;
}

 

 

全部评论

相关推荐

Gaynes:查看图片
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务