0

I want to use system's date/time which is in mm/dd/yy format in code. But the problem is that the time that I am getting is not in ate/time format. So I want to change it to CTime format so that I can use it. How is this going to be possible? How can I convert the CString into CTIme format?

Regards,

Mohan

karthik
  • 17,453
  • 70
  • 78
  • 122

1 Answers1

3

The sample for your issue is as follows:

   COleDateTime myDtTime;
   CTime sysTime;
   if(myDtTime.ParseDateTime(strTimestampOther))
   {
          SYSTEMTIME st;
         if(myDtTime.GetAsSystemTime(st))
         {
               sysTime = st;
           }
   }
   else
   ASSERT(FALSE);
karthik
  • 17,453
  • 70
  • 78
  • 122