DateTime_SetFormatDateTime_SetFormat*
*Contents  *Index  *Topic Contents
*Previous Topic: DateTime_GetSystemtime
*Next Topic: DateTime_SetMonthCalColor

DateTime_SetFormat


void DateTime_SetFormat(
    HWND hwndDT,
    LPCTSTR lpszFormat);

Sets the display of a date and time picker (DTP) control based on a given format string. You can use this macro or send the DTM_SETFORMAT message explicitly.

hwndDT
Handle to a DTP control.
lpszFormat
Address of a zero-terminated format string that defines the desired display. Setting this parameter to NULL will reset the control to the default format string for the current style.

It is acceptable to include extra characters within the format string to produce a more rich display. However, any nonformat characters must be enclosed within single quotes. For example, the format string "'Today is: 'hh':'m':'s ddddMMMdd', 'yyy" would produce output like "Today is: 04:22:31 Tuesday Mar 23, 1996".

Version 4.70

Note A DTP control tracks locale changes when it is using the default format string. If you set a custom format string, it will not be updated in response to locale changes.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.