Link to home
Start Free TrialLog in
Avatar of Mark Ebden
Mark Ebden

asked on

Accessing the year

How do I access the current year using MFC?  What is the  specific syntax?
ASKER CERTIFIED SOLUTION
Avatar of warmcat
warmcat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Answers2000
Answers2000


or

int nYear = COleDateTime::GetCurrentTime().GetYear() ;

Avatar of Mark Ebden

ASKER

I like Answers2000's answer better, since the proposed answer failed to work in Windows 95 -- although it worked on Windows NT.  Thanks,

Mark
Mark,

Thanks for accepting the answer, but I have used the above code in '95 without problems.  What behaviour did you experience?

Regards,

-Andy
Andy,

I think it was "this program has performed an illegal operation... etc."

I can't remember excatly.
Mark,

Very odd.  I should think it was some other code caused the exception, because I have used the above code in shipping products without any trouble.  I should also think that the COleDateTime probably calls down to the same code.

Regards,

-Andy