导航

time_t、struct tm和ctime的转换

Posted on 2009-03-23 15:11  Phil Wang  阅读(2197)  评论(0编辑  收藏  举报

1, time_t  转 struct tm

    struct tm *localtime( const time_t *timer );

2,struct tm 转 time_t

    time_t mktime( struct tm *timeptr );

3,ctime 转 time_t

 ctime类中的gettime成员函数即可