[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

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
0
needhlp
Asked:
needhlp
1 Solution
 
migelCommented:
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now