C++中实现 time_t, tm 相互转换

time_t -> tm: localtime

tm -> time_t: mktime

  time_t curTime;
    time(&curTime);

    dwCurTime = curTime;

    struct tm *mytm = localtime(&curTime);

    time_t time2 = mktime(mytm);

 

posted @ 2013-07-17 18:10  nchxmoon  阅读(5587)  评论(0编辑  收藏  举报