System time

Does anyone know how to display the system time\date\mins\etc  in a CString?

I know you have to use GetSystemTime,  but does anyone have an example I could use.  thanx
needhlpAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
migelConnect With a Mentor Commented:
Try to use this code
   CTime timeWrite;   timeWrite = CTime::GetCurrentTime();
   // write the time out
   CString str = timeWrite.Format("%d %b %y %H:%M:%S");
//  look help for the CTime::Format to understand format symbols
0
 
needhlpAuthor Commented:
Whoa, thanx!  : )

how do you get the months to display as numbers?

thanx again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.