标签:
#include <windows.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int main( void )
{
SYSTEMTIME sys;
GetLocalTime( &sys );
printf( "%4d/%02d/%02d %02d:%02d:%02d.%03d 星期%1d\n",sys.wYear,sys.wMonth,sys.wDay,sys.wHour,sys.wMinute, sys.wSecond,sys.wMilliseconds,sys.wDayOfWeek);
//sys.wYear
//sys.wMonth,
//sys.wDay,
sys.wHour = 2;
sys.wMinute =0;
sys.wSecond = 0;
sys.wMilliseconds = 0;
sys.wDayOfWeek = 1;
SetLocalTime( &sys );
cout<<"System now time is: ";
printf( "%4d/%02d/%02d %02d:%02d:%02d.%03d 星期%1d\n",sys.wYear,sys.wMonth,sys.wDay,sys.wHour,sys.wMinute, sys.wSecond,sys.wMilliseconds,sys.wDayOfWeek);
return 0;
}
标签:
原文地址:http://www.cnblogs.com/tianxia2s/p/4401174.html