社区
界面
帖子详情
mfc 的编辑框中怎么显示系统的当前时间啊
琴乐音
2007-01-24 09:54:19
如题!!!
CTime theTime;
theTime = CTime::GetCurrentTime();
取得时间, 但是怎么显示出来呢
...全文
859
14
打赏
收藏
mfc 的编辑框中怎么显示系统的当前时间啊
如题!!! CTime theTime; theTime = CTime::GetCurrentTime(); 取得时间, 但是怎么显示出来呢
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
14 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
xixuanfong
2007-02-01
打赏
举报
回复
楼上正解很多,不多罗嗦了哦,顶一下,呵呵
iProgramer
2007-02-01
打赏
举报
回复
来晚了
haoguozhong
2007-02-01
打赏
举报
回复
来晚了
yixiao386
2007-01-30
打赏
举报
回复
来晚了 没的说了 呵呵
lid0770
2007-01-30
打赏
举报
回复
CTime tm = CTime::GetCurrentTime();
CString sTime = tm.Format("%X");
cEdit.SetWindowText(sTime);
nadine
2007-01-30
打赏
举报
回复
dazedase说的对啊
miaoshengwu
2007-01-27
打赏
举报
回复
GetDlgItem(IDC_EDIT1)->SetWindowText("时间字符串");
jerry4711
2007-01-27
打赏
举报
回复
在OnTimer函数中写:
CTime tCurrentTime; //当前时间变量
int ih,im,is; //记录小时、分钟、秒的整型变量
tCurrentTime=CTime::GetCurrentTime(); //取得当前时间
ih=tCurrentTime.GetHour(); //取得当前时间小时数
im=tCurrentTime.GetMinute(); //取得当前时间分钟数
is=tCurrentTime.GetSecond(); //取得当前时间秒数
m_strCurr.Format("现在时间是%d点%d分%d秒",ih,im,is); //格式化字符串
UpdateData(FALSE);
dazedase
2007-01-26
打赏
举报
回复
最简单的方法:
CString m_strTime ;
CTime theTime;
theTime = CTime::GetCurrentTime();
m_strTime =theTime.Format("%Y/%m/%d %H:%M:%S");//Format注意大小写!!
再将m_strTime 显示到编辑框即可
东文-桑晨
2007-01-24
打赏
举报
回复
CTime theTime;
theTime = CTime::GetCurrentTime();
CString str;
str.Format("%d-%d-%d %d:%d:%d",
theTime.GetYear(), theTime.GetMonth(), theTime.GetDay(),
theTime.GetHour(), theTime.GetMinute(), theTime.GetSecond());
//年月日时分秒的顺序随你排列,就是说theTime.GetYear(), theTime.GetMonth(),
//theTime.GetDay(), theTime.GetHour(), theTime.GetMinute(), theTime.GetSecond());
//可以任意调换
SetDlgItemText(IDC_EDIT1,str);//IDC_EDIT1是你的编辑框空件的ID
pyrophile
2007-01-24
打赏
举报
回复
还要调用UpdateData(false);函数
niying
2007-01-24
打赏
举报
回复
if m_strTime = 编辑框
{
m_strTime.Format("%04d-%02d-%02d %02d:%02d:%02d", theTime.GetYear(),theTime.GetMonth(),...);
UpdateData(false);
}
王国凡
2007-01-24
打赏
举报
回复
再调用 SetDlgItemText 把 str 设置到编译框中.
王国凡
2007-01-24
打赏
举报
回复
CTime theTime;
theTime = CTime::GetCurrentTime();
CString str;
str.Format("%d-%d-%d %d:%d:%d",
theTime.GetYear(), theTime.GetMonth(), theTime.GetDay(),
theTime.GetHour(), theTime.GetMinute(), theTime.GetSecond());
MFC
动态
显示
当前
时间
实时的
显示
当前
系统
时间
,精确至秒
MFC
CTime类 ontime
时间
响应
MFC
编辑框
、静态文本框相关的常用函数
MFC
编辑框
、静态文本框相关的常用函数 非常详细,可以当查询手册使用
vc++
MFC
应用
显示
当前
时间
vc++如何
显示
当前
时间
vc++如何
显示
当前
时间
vc++如何
显示
当前
时间
MFC
系统
时钟 状态栏
显示
时间
用
MFC
实现的
系统
时钟。添加了背景图片。状态栏
显示
时间
。
MFC
使用CEF浏览器内核
关于
MFC
如何
中
如何使用CEF浏览器内核实例,结合我的文章,做你想做的!
界面
15,980
社区成员
115,867
社区内容
发帖
与我相关
我的任务
界面
VC/MFC 界面
复制链接
扫一扫
分享
社区描述
VC/MFC 界面
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章