急急急。C语言如何获取当时的时间 年月日时分秒 存在一维数组中或者转化为整型。
这个用C本身的函数就可以time_t time(time_t *timer);time gives the current time, in seconds, elapsed since 00:00:00 GMT, January 1, 1970, and stores that value in the location pointed to by timer, provided that timer is not a NULL pointer。 #include #include int main(void){ time_t t; t = time(NULL); prin...全部
这个用C本身的函数就可以time_t time(time_t *timer);time gives the current time, in seconds, elapsed since 00:00:00 GMT, January 1, 1970, and stores that value in the location pointed to by timer, provided that timer is not a NULL pointer。
#include #include int main(void){ time_t t; t = time(NULL); printf("The number of seconds since January 1, 1970 is %ld",t); return 0;}。
收起