社区
界面
帖子详情
CString 转 time_t ?
pirates_fish
2012-01-17 10:41:56
CString 转 time_t 怎么转,比如CString a = 1326597846;
...全文
409
9
打赏
收藏
CString 转 time_t ?
CString 转 time_t 怎么转,比如CString a = 1326597846;
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
秦剑
2012-01-17
打赏
举报
回复
typedef long time_t; /* 时间值time_t 为长整型的别名*/
time_t 其实是个整数,把CString 变为整数就可以了。
用atoi就可以,如果是定义了UNICODE用相应的Unicode形式就可以了。
xuanfeng007
2012-01-17
打赏
举报
回复
这个以前好像有人问过,参考http://topic.csdn.net/t/20030916/12/2264976.html
Eleven
2012-01-17
打赏
举报
回复
_tcstoul();行不?
酒红色的泪
2012-01-17
打赏
举报
回复
其实就是字符串转长整形嘛
saiyaman5
2012-01-17
打赏
举报
回复
_ttol((LPCTSTR)a);
pirates_fish
2012-01-17
打赏
举报
回复
解决了
lgstudyvc
2012-01-17
打赏
举报
回复
CString是个啥?要是"汉字",那可转不了
要是"32661122"(秒的话),那就formt
转为时间可以
另外时间,CTimeSpan类也挺好使
haidaoyu123
2012-01-17
打赏
举报
回复
http://blog.163.com/pirates_fish/blog/static/1833331502012017114651632/
oyljerry
2012-01-17
打赏
举报
回复
_ttol()
C
String
,char,int,COleDate
Time
,C
Time
,
time
_t之间的相互
转
换
这些类型的
转
换在开发数据库应用时很有用,也比较齐全
c语言
time
_t
转
ole
time
,C
Time
、COleDate
Time
和C
String
之间的相互
转
化 | 求索阁
C
String
--->COleDate
Time
:方法1:COleDate
Time
::ParseDate
Time
()C
String
strDate = _T("1987-06-21");COleDate
Time
oleDate;oleDate.ParseDate
Time
(strDate, VAR_DATEVALUEONLY);方法2:COleVariantC
String
strDate = _...
时间格式
转
换 从C
String
到SYSTEM
TIME
,再
转
换到
time
_t,以求得时间差
将C
String
的时间
转
换成其它类型,以求得两个的时间差
VC++ 时间类型
转
换: C
Time
, COleDate
Time
,
time
_t, C
String
C
Time
==>C
String
C
Time
time
;
time
.GetCurrent
Time
();
C
String
str;
str.Format("%s",
time
.Format("%y:%m:%d %H-%M-%S")
1
C
String
str;
C
Time
t = C
Time
::GetCurrent
Time
();
str.Format("%d-%d-%d",t.GetYear(),
C++
time
_t与
string
的互相
转
换
时间格式:"YYYY-MM-DD 11:11:11" 1.
string
转
time
_t
time
_t
String
ToDate
time
(std::
string
str){...
界面
15,979
社区成员
115,896
社区内容
发帖
与我相关
我的任务
界面
VC/MFC 界面
复制链接
扫一扫
分享
社区描述
VC/MFC 界面
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章