时间戳转化为标准时间
- void CMysqlDaps::Stamptotime(const int time_stamp,TABLE_DATE &table_date)
- {
- time_t tmp_timestamp = (time_t) time_stamp;
-
- struct tm *time_stampinfo;
- time_stampinfo = localtime ( &tmp_timestamp);
- table_date.year = time_stampinfo->tm_year+1900;
- table_date.month = time_stampinfo->tm_mon+1;
- table_date.day = time_stampinfo->tm_mday;
- table_date.week = time_stampinfo->tm_wday;
- }
table_date为一个结构体,year,month,day 都为int 类型
阅读(1012) | 评论(0) | 转发(0) |