Get Current Time in mm/dd/yyyy in C++

I am using the following code for setting the time in a Date Control in MFC using C++

CTime date;
date = date.GetCurrentTime();
this->m_headerDate.SetTime(&date);

This will get the Date and set it to the control in what ever format the user machine uses. But I want to set it to a format of ONLY mm/dd/yyyy. There should be some way of doing this in MFC. Are there any utility functions for this?

Thanks,

Leave a Comment