📄 subject_14328.htm
字号:
<p>
序号:14328 发表者:haihua 发表日期:2002-09-05 20:42:23
<br>主题:请问在VC里如何取系统时间
<br>内容:请问在VC里如何取系统时间,并使用它作为程序中的运行时间显示,因为程序中用到计时。(我说的不是定时器的使用)。
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:零 回复日期:2002-09-05 21:33:00
<br>内容:GetSystemTime<BR>The GetSystemTime function retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC). <BR><BR>VOID GetSystemTime(<BR> LPSYSTEMTIME lpSystemTime // address of system time structure<BR>);<BR> <BR>Parameters<BR>lpSystemTime <BR>Pointer to a SYSTEMTIME structure to receive the current system date and time. <BR>Return Values<BR>This function does not return a value. <BR><BR>QuickInfo<BR> Windows NT: Requires version 3.1 or later.<BR> Windows: Requires Windows 95 or later.<BR> Windows CE: Requires version 1.0 or later.<BR> Header: Declared in winbase.h.<BR> Import Library: Use kernel32.lib.<BR><BR>See Also<BR>Time Overview, Time Functions, GetLocalTime, GetSystemTimeAdjustment, SetSystemTime, SYSTEMTIME <BR><BR> <BR>NOTE; which is copied from MSDN.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:willing 回复日期:2002-09-07 12:49:50
<br>内容: CTime t=CTime::GetCurrentTime();<BR> char szTime[6];<BR> int nHour=t.GetHour();<BR> int nMinute=t.GetMinute(); <BR> int nSecond=t.GetSecond();<BR>// if (nHour>12) nHour=nHour-12;//按12小时制显示
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:74LS373 回复日期:2002-09-08 09:49:36
<br>内容:CTime t=CTime::GetCurrentTime();<BR>CString str;<BR>str=t.format("%y/%m...%M:%S");<BR><BR>str即可作为显示字符串。<BR><BR>%*可见MSDN。<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -