Format Characters

Format characters supported by DTP controls are described in the following table.

String fragment Description
"d" The one-digit or two-digit day.
"dd" The two-digit day. Single-digit day values are preceded by a zero.
"ddd" The three-character weekday abbreviation.
"dddd" The full weekday name.
"gg" The period/era string contained in the CAL_SERASTRING value associated with the specified locale. Windows CE ignores this element if the date to be formatted does not have an associated era or period string.
"h" The one-digit or two-digit hour in 12-hour format.
"hh" The two-digit hour in 12-hour format. Single-digit values are preceded by a zero.
"H" The one-digit or two-digit hour in 24-hour format.
"HH" The two-digit hour in 24-hour format. Single-digit values are preceded by a zero.
"m" The one-digit or two-digit minute.
"mm" The two-digit minute. Single-digit values are preceded by a zero.
"M" The one-digit or two-digit month number.
"MM" The two-digit month number. Single-digit values are preceded by a zero.
"MMM" The three-character month abbreviation.
"MMMM" The full month name.
"t" The one-letter AM/PM abbreviation (that is, "AM" is displayed as "A").
"tt" The two-letter AM/PM abbreviation (that is, "AM" is displayed as "AM").
"X" The callback field. The control uses the other valid format characters and queries the application to fill in the "X" portion of the string. The application must be prepared to handle the DTN_WMKEYDOWN, DTN_FORMAT, and DTN_FORMATQUERY notification messages. Multiple "X" characters can be used in a series to signify unique callback fields.
"y" The one-digit year. For example, 1996 would be displayed as "6."
"yy" The last two digits of the year. For example, 1996 would be displayed as "96."
"yyy" The full year. For example, 1996 would be displayed as "1996."