问题由来
时间戳转换(时间戳:自 1970 年1月1日(00:00:00 )至当前时间的总秒数。)
#include
#include int main(int argc, const char * argv[])
{
time_t t;
struct tm *p;
t=1408413451;
p=gmtime(&t);
char s[80];
strftime(s, 80, %Y-%m-%d %H:%M:%S, p);
printf(%d: %sn, (int)t, s);
}
结果
14084134
- 1
- 2
前往页