如何获得时钟的时间(非启动时间)?

harry007 2003-12-12 03:10:22
如何获得时钟的时间(非启动时间)?
...全文
30 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
baoyuhua 2003-12-13
  • 打赏
  • 举报
回复
GetTimeFormat()
shenpengfei684 2003-12-13
  • 打赏
  • 举报
回复
定义:SYSTEMTIME t;
调用函数:GetLocalTime(&t);
得到:t.wHour
t.wminute
t.wsecond即为本机器的小时、分、秒。
它们是WORD型的
baoyuhua 2003-12-13
  • 打赏
  • 举报
回复
GetTimeFormat()获取系统当前时间并格式化输出
sboom 2003-12-12
  • 打赏
  • 举报
回复
GetSystemTime 得到的UTC时间,GetLocalTime 才能得到正确的本地时间。

The GetLocalTime function retrieves the current local date and time.

VOID GetLocalTime(
LPSYSTEMTIME lpSystemTime // address of system time structure
);Parameters
lpSystemTime
Pointer to a SYSTEMTIME structure to receive the current local date and time.
Return Values
This function does not return a value.

///////////////////////////////////////////////////////
GetSystemTime
The GetSystemTime function retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC).

VOID GetSystemTime(
LPSYSTEMTIME lpSystemTime // address of system time structure
);

Parameters
lpSystemTime
Pointer to a SYSTEMTIME structure to receive the current system date and time.
Return Values
This function does not return a value.

wos 2003-12-12
  • 打赏
  • 举报
回复
调用api三.GetSystemTime.
broadoceans 2003-12-12
  • 打赏
  • 举报
回复
VOID GetSystemTime(
LPSYSTEMTIME lpSystemTime // address of system time structure
);

18,355

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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