Click to See Complete Forum and Search --> : How to get current time in .net form?


foxhunt99
March 10th, 2008, 01:04 PM
Hi, I am building a form application using VC++ 2008.
I know in CTime class there is a getcurrenttime function. But how do I do this in .net framework?
I tried #include <ctime> it won't let me access ctime.

Thanks.

darwen
March 10th, 2008, 02:57 PM
Have a look at


System::DateTime::Current


And you shouldn't be using MFC classes in a .NET application, so it's good that it's given you an error. You should use a .NET class if one is available (which most of the time there is).

Darwen.