sscanf 小记

来源:互联网 发布:e4a直播盒子系统源码 编辑:程序博客网 时间:2024/05/27 09:45
///<  把 "20110115T124204Z" 这种格式的时间字串 转换成  SYSTEMTIME 对象bool StringToSystemTime(IN std::string strTime, OUT SYSTEMTIME & st){__try{sscanf(strTime.c_str(),"%4d%2d%2dT%2d%2d%2dZ",&st.wYear,&st.wMonth,&st.wDay,&st.wHour,&st.wMinute,&st.wSecond);}__except(EXCEPTION_EXECUTE_HANDLER){OutputDebugStringW(L"Formant time string exception !\n");return false;}return true;}


原创粉丝点击