3

In smart device MFC application:

I have successfully converted CTime to CString. Now I want to convert it back, CString to CTime. How can I do that?

user001
  • 444
  • 5
  • 10

2 Answers2

5

Use COleDateTime::ParseDateTime(CString) and then convert it to CTime.

dwo
  • 3,576
  • 2
  • 22
  • 39
1

Check out the example mentioned in this MSDN doc page: COleDateTime::ParseDateTime

yasouser
  • 5,113
  • 2
  • 27
  • 41
  • 1
    Your link no longer works, it takes you to a page to download the help for VS 2013. this one works now, who knows if it will work in the future: [COleDateTime::ParseDateTime](https://learn.microsoft.com/en-us/cpp/atl-mfc-shared/reference/coledatetime-class?view=msvc-170#parsedatetime) – David Parvin Jan 20 '22 at 15:23