怎样定时修改系统时间?

blueice2002 2003-07-08 05:17:33
怎样定时修改系统时间?
就是说,到如果要每天到下午6点,就把时间改为6:00:04,怎么做?
是不是要调用windows的api函数?
...全文
74 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
baobeixiong 2003-07-18
  • 打赏
  • 举报
回复
agree
无敌魔仙 2003-07-09
  • 打赏
  • 举报
回复
The following example sets the system time using the SetSystemTime function.

// SetNewTime - sets system time
// Return value - TRUE if successful, FALSE otherwise
// hour - new hour (0-23)
// minutes - new minutes (0-59)

BOOL SetNewTime(WORD hour, WORD minutes)
{
SYSTEMTIME st;
char *pc;

GetSystemTime(&st); // gets current time
st.wHour = hour; // adjusts hours
st.wMinute = minutes; // and minutes
if (!SetSystemTime(&st)) // sets system time
return FALSE;
return TRUE;
}
blueice2002 2003-07-08
  • 打赏
  • 举报
回复
有人做过类似的东东吗?能否给look一下?多谢了!
icr_mio 2003-07-08
  • 打赏
  • 举报
回复
SetSystemTime
SetLocalTime
dz_w 2003-07-08
  • 打赏
  • 举报
回复
GetSystemTime//得到时间
SetSystemTime//修改时间

2,586

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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