[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

Converting CDate to string

Could anyone tell me how to convert CDate to string with the format of "dd/mm/yyyy"?
0
csound
Asked:
csound
  • 2
  • 2
1 Solution
 
AlexFMCommented:
CDate class doesn't exist, do you mean CTime or COleDateTime class?
Both of them have Format function.
0
 
csoundAuthor Commented:
Sorry I meant CTime..
0
 
AlexFMCommented:
   CTime t = CTime::GetCurrentTime();

    CString s;
    s.Format(_T("%02d/%02d/%04d"),
        t.GetDay(), t.GetMonth(), t.GetYear());
0
 
csoundAuthor Commented:
Thank you for your help. =)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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