Solved

System time

Posted on 1999-01-15
2
170 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:needhlp
2 Comments
 
LVL 12

Accepted Solution

by:
migel earned 50 total points
ID: 1327770
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
 

Author Comment

by:needhlp
ID: 1327771
Whoa, thanx!  : )

how do you get the months to display as numbers?

thanx again
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now