#include
#include
#include
int main(int argc,char **argv)
{
time_t time_now;
struct tm *curr_time = NULL;
time(&time_now);
printf("time_now:[%ld]\n",time_now);
curr_time = gmtime(&time_now);
printf("gmtime[%02d:%02d:%02d]\n",curr_time->tm_hour, curr_time->tm_min, curr_time->tm_sec);
curr_time = localtime(&time_now);
printf("localtime[%d.%02d.%02d %02d:%02d:%02d]\n",(1900 + curr_time->tm_year),(1 + curr_time->tm_mon),curr_time->tm_mday,curr_time->tm_hour,curr_time->tm_min,curr_time->tm_sec);
return 0;
}
阅读(9194) | 评论(0) | 转发(0) |