首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

MFC如何将字符串日期“2012-12-15”之类的转换成时间戳呢

2012-03-08 
MFC怎么将字符串日期“2012-12-15”之类的转换成时间戳呢?MFC怎么将字符串日期“2012-12-15”之类的转换成时间

MFC怎么将字符串日期“2012-12-15”之类的转换成时间戳呢?
MFC怎么将字符串日期“2012-12-15”之类的转换成时间戳呢?

[解决办法]
boost中有函数可用。

C/C++ code
#include "stdafx.h"#include "boost/date_time/posix_time/posix_time.hpp"using namespace boost::posix_time;int _tmain(int argc, _TCHAR* argv[]){    std::string ts("2002-01-20 23:59:59.000");    ptime t(time_from_string(ts));    tm pt_tm = to_tm( t ); 

热点排行