#include <time.h> void TimeDisp(void) { time_t nowTime; nowTime = time(NULL); struct tm* sysTime = localtime(&nowTime); nowTime = time(NULL); sysTime = localtime(&nowTime); printf("系统时间:%d年%d月%d日%d时%d分%d秒\n", sysTime->tm_year + 1900, \ sysTime->tm_mon + 1, sysTime->tm_mday, sysTime->tm_hour, sysTime->tm_min, sysTime->tm_sec); }