MFC下怎么获取系统时间?

LeeTop 2005-07-04 04:09:37
MFC下怎么获取系统时间?
...全文
2196 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
漂流的代码 2005-07-05
  • 打赏
  • 举报
回复
说明以下:
GetSystemTime取得标准时间,也就是格林威枝时间
GetSystemTime就是取得系统本地的时间,如在中国,就是北京时间,在日本,就是东京时间
还有SYSTEMTIME最后一个成员,能去的当前的微秒
LeeTop 2005-07-05
  • 打赏
  • 举报
回复
如果 我还要得到微秒呢?
Format()这里的参数应该填什么呢??
LeeTop 2005-07-05
  • 打赏
  • 举报
回复
我要得到,比如晚上10点12分56秒 表示为: 22:12:56

CTime t = CTime::GetCurrentTime();
CString nowTime = t.Format(这里应该填什么呢?);

Format()这里的参数应该填什么呢??
JedyWoody 2005-07-05
  • 打赏
  • 举报
回复
GetLocalTime(LPSYSTEMTIME lpSystemTime)
ljp3000 2005-07-05
  • 打赏
  • 举报
回复
CTime通过SYSTEMTIME也不能取的当前的微秒
GetAsSystemTime stores the resulting time in the referenced timeDest structure. The SYSTEMTIME data structure initialized by this function will have its wMilliseconds member set to zero.
hasgone 2005-07-05
  • 打赏
  • 举报
回复
双击一个文件的时候,
和该文件关联的程序会自动运行,
请问在关联的应用程序中怎样获得该文件名?(不用mfc的doc-view)
谢谢!
--- 初来乍到,还不会发帖,只好借鸡下蛋,恳请原谅!
wallgrid 2005-07-05
  • 打赏
  • 举报
回复
CTime t = CTime::GetCurrentTime();
becool3000 2005-07-05
  • 打赏
  • 举报
回复
SYSTEMTIME time;
CDateTimeCtrl*m_TimeCtrl=(CDateTimeCtrl*)GetDlgItem(IDC_DATETIMEPICKER4);
DateTime_GetSystemtime(m_TimeCtrl->m_hWnd,&time);
CString time1;
time1.Format(" %d-%d-%d",time.wYear,time.wMonth,time.wDay);
里面用到时间控件,绝对可以!先得到空件 在操作
还有可以改变时的操作
NMDATETIMECHANGE*lpChange=(LPNMDATETIMECHANGE)pNMHDR;

SYSTEMTIME time;
CDateTimeCtrl*m_TimeCtrl=(CDateTimeCtrl*)GetDlgItem(IDC_TIMEPICKER);
DateTime_GetSystemtime(m_TimeCtrl->m_hWnd,&time);

CString Date;
Date.Format("%d-%d-%d %d:%d:%d",lpChange->st.wYear,lpChange->st.wMonth,lpChange->st.wDay,
time.wHour,time.wMinute,time.wSecond);
希望对你有帮助!
lzzqqq 2005-07-05
  • 打赏
  • 举报
回复
COleDateTime oleDt=COleDateTime::GetCurrentTime();
CString strFileName=oleDt.Format("%y年%m月%d日 %H时%M分%S秒");
::MessageBox(NULL,strFileName,MB_OK);
gooyan 2005-07-04
  • 打赏
  • 举报
回复
http://sourceoflife.blogchina.com/1847677.html
vicky_jam 2005-07-04
  • 打赏
  • 举报
回复
SYSTEMTIME curTime;
GetLocalTime( &curTime );
zhang_zhibin 2005-07-04
  • 打赏
  • 举报
回复
time_t t = time( NULL );
rolen 2005-07-04
  • 打赏
  • 举报
回复
CTime::GetCurrentTime(),
GetSystemTime()
idAnts 2005-07-04
  • 打赏
  • 举报
回复
GetLocalTime(LPSYSTEMTIME lpSystemTime)
xkit 2005-07-04
  • 打赏
  • 举报
回复
GetSystemTime(LPSYSTEMTIME lpSystemTime)
bager 2005-07-04
  • 打赏
  • 举报
回复
CTime t = CTime::GetCurrentTime();
LeeTop 2005-07-04
  • 打赏
  • 举报
回复
MFC下怎么获取系统时间?

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧