i am using C++ win32 API…
i have these values.
pwdlastset date(ex:25-9-2012), current date(ex:1-11-2012), maxpwdage
count(ex 54 days) pwdwarningdays(14 days)…
Now i want to calculate password expiry date…
i have try the below code…
if(lastpwdchmon==currentMonth)
{
lCount=currentDay-lastpwdchday;
}
else if(lastpwdchmon<currentMonth)
{
lCount=((currentDay+30)-lastpwdchday);
}
but,i have a problem…
i mean,just i need to calculate how many days between the currentdate & pwdlastset date?
How to achieve this?
DATEisCOMapproach to hold date/time. its integral part contain number of days from an epoch(doesn’t matter here) and fractional part indicate time of the day. So to compute number of days between 2DATEyou can do this:To get current date as
DATEyou can use:To convert fields of date/time into
DATEyou may use: