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);

 

注:上一篇获得的时间是标准格林威治时间。

posted @ 2012-09-09 14:21  Dsp Tian  阅读(473)  评论(0编辑  收藏  举报