size_t
strftime (char *s, size_t maxsize, const char *format, const struct tm *tp); //格式化输出函数
utc_time = time (NULL);
local_time = localtime(&utc_time);
strftime(str_time, sizeof(str_time), "%Y-%m-%d,%H:%M:%S", local_time);
printf ("Time: %s/n", str_time);
return 0;
}
运行输出:
./time
Time: 2009-08-14,13:59:22