#include头文件 然后 time_t t; time(&t); 输出 ctime(&t) 具体为: #include #include int main(void) { time_t t; time(&t); printf("Today's date and time: %s\n", ctime(&t)); return 0; }