Solved

System time

Posted on 1999-01-15
2
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 97
Separate into files by filename 12 92
how to monitor remote shell execution on linux 9 113
format the code in java 6 116
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

734 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