By default, date and time picker controls provide three format types (each format corresponding to a unique style) for displaying the current date or time:
However, you can customize the appearance of the date or time by using a custom format string. This custom string is comprised of either existing format characters, nonformat characters, or a combination of both. Once the custom string is built, make a call to CDateTimeCtrl::SetFormat passing in your custom string. The date and time picker control will then display the current value using your custom format string.
The following example code (where m_dtPicker
is the CDateTimeCtrl object) demonstrates one possible solution:
CString formatStr= _T("'Today is: 'yy'/'MM'/'dd");
m_dtPicker.SetFormat(formatStr);
In addition to custom format strings, date and time picker controls also support callback fields.