我正在使用 C++ win32 API...
我有这些值(value)观。
pwdlastset date(ex:25-9-2012), current date(ex:1-11-2012), maxpwdage count(ex 54 days) pwdwarningdays(14 days)...
现在我想计算密码到期日期...
我试过下面的代码...
if(lastpwdchmon==currentMonth)
{
lCount=currentDay-lastpwdchday;
}
else if(lastpwdchmon<currentMonth)
{
lCount=((currentDay+30)-lastpwdchday);
}
但是,我有一个问题...
我的意思是,我只需要计算当前日期和 pwdlastset 日期之间的天数?
如何实现?
最佳答案
很难知道您的 DATE 是什么,但如果您在 time_t 中获得了所有日期,那么只需将两者相减并将结果除以 86400 (60*60*24)。
关于c++ - 如何使用 C++ Win32 API 计算两个日期之间的天数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13176662/