[C语言] 时间操作,把1970年开始秒数计算的时间,转换为字符串格式输出;

    struct tm *ptr;
    time_t lt;
    unsigned int times=<秒数时间变量>;
    char str[80];
    lt=times;
    ptr=localtime(&lt);
    strftime(str,100,"%F %X",ptr);

摘抄来的,来源忘记了。。。

------------
微博:http://weibo.com/scue
Github:http://github.com/scue
原文地址:https://www.cnblogs.com/scue/p/2983856.html