time_t nowTime=time(0); struct tm* nowTimeStruct=localtime(&nowTime); output<<"系统当前时间:"<<1900+nowTimeStruct->tm_year<<"."<<nowTimeStruct->tm_mon<<"."<< nowTimeStruct->tm_mday<<" "<<nowTimeStruct->tm_hour<<":"<<nowTimeStruct->tm_min<<":"<<nowTimeStruct->tm_sec<<endl;
所需包含的头文件:<time.h>