typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *LPSYSTEMTIME;
SetLocalTime修改成本地时间
SetSystemTime修改成格林威治时间、
int m_Year;
int m_Month;
int m_Day;
int m_Hour;
int m_Minute;
int m_Second;
SYSTEMTIME sysTime;
// memset(&sysTime, 0, sizeof(sysTime));
//刚开始接触Windows编程时候的,后来听说这个不能注释,不知道当时我的是不是执行成功了。
sysTime.wYear =m_Year;
sysTime.wMonth =m_Month;
sysTime.wDay = m_Day;
sysTime.wHour =m_Hour;
sysTime.wMinute =m_Minute;
sysTime.wSecond =m_Second;
SetLocalTime(&sysTime);
开始为了简单测试,只对m_Hour进行了修改,却没用对其他时间参数进行初始化,导致调用失败
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ezhong的博客签名-------------------------------------
以上内容来自ezhong的博客园,作者:ezhong
ezhong的博客园: http://www.cnblogs.com/ezhong
感谢您的阅读。感谢您的分享。