程序如下:[code:1]
#include<time.h>
main()
{
time_t timep;
time (&timep);
printf(" Ctime get time is: %s",ctime(&timep));
printf("Asctime get time is: %s",asctime(gmtime(&timep)));
}[/code:1]
执行结果如下:[code:1]
[root@echo home]# ./time
Ctime get time is: Thu Nov 11 19:17:13 2004
Asctime get time is: Thu Nov 11 11:17:13 2004 //与上面的不同,??? :?:
[root@echo home]#[/code:1]