Linux练习(时间变为本地常用时间)
#include <time.h> #include <stdio.h> int main() { time_t the_time; (void)time(&the_time); printf("The date is: %s",ctime(&the_time)); return 0; }
函数原型:
#include <time.h>
char *ctime(const time_t *timeval);
注:上一篇获得的时间是标准格林威治时间。
#include <time.h> #include <stdio.h> int main() { time_t the_time; (void)time(&the_time); printf("The date is: %s",ctime(&the_time)); return 0; }
函数原型:
#include <time.h>
char *ctime(const time_t *timeval);
注:上一篇获得的时间是标准格林威治时间。