您的位置:首页 > 编程语言 > C语言/C++

c++学习笔记--改变系统时间

2017-08-31 13:19 411 查看
#include <iostream>

#include <Windows.h>

int main(){

//声明变量

SYSTEMTIME sys_time;

//将变量值设置为本地时间

GetLocalTime( &sys_time );

//输出时间

printf( "%4d/%02d/%02d %02d:%02d:%02d.%03d 星期%1d\n",sys_time.wYear,

sys_time.wMonth,

sys_time.wDay,

sys_time.wHour,

sys_time.wMinute,

sys_time.wSecond,

sys_time.wMilliseconds,

sys_time.wDayOfWeek);

system("time");

system("pause");

return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: