CTime time = CTime::GetCurrentTime();
CString strTime = time.Format("%H:%M:%S");
输出时间17:02:00
由于我需要在系统时间上加上一个偏移,采用一下方法
h=(int)t.wHour;
min=(int)t.wMinute;
s=(int)t.wSecond;
CString strTime;
strTime.Format("%d :%d:%d:",h,min,s);
输出时间格式为17:2:0
有没有比较好的方法改善!(除用if判断)
CString strTime = time.Format("%H:%M:%S");
输出时间17:02:00
由于我需要在系统时间上加上一个偏移,采用一下方法
h=(int)t.wHour;
min=(int)t.wMinute;
s=(int)t.wSecond;
CString strTime;
strTime.Format("%d :%d:%d:",h,min,s);
输出时间格式为17:2:0
有没有比较好的方法改善!(除用if判断)
解决方案 »
- 这是什么错误illegal else without matching if
- 关于组合框的问题
- 很奇怪的macro的用法 #define XXX //
- 如何得到Dialog里弹出菜单的句柄
- 同样的问题 CInternetSession ::GetFtpConnection
- 怪现象,开机时串口接了不停发数据的设备,启动就不正常。谁知道原因?
- 清华大学出版社在95年曾经出版过<<win 32 程序员参考大全>>一套书。其中第五本书“消息,结构和宏”在网上找不到很全的电子本......
- 关于免费手机短信---网易短信王的问题
- --------------------功能不变修改软件界面 求思路-------------------
- 如何将自己的软件打包发布
- 使用VC编写的一个COM 组件,有一个函数要返回一个ADODB.RecordSet的实例,该怎么做啊?
- 关于qq中热键
是想后来也显示
17:02:00??
strTime.Format("%02d :%02d:%02d:",h,min,s);
是这个意思吗
CTimeSpan ts(0,1,1,1);
t += ts; //增加零天一小时一分一秒
TRACE(t.Format("%H:%M:%S"));