Skip to content

Latest commit

 

History

History
72 lines (42 loc) · 2.22 KB

dtm-setformat.md

File metadata and controls

72 lines (42 loc) · 2.22 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
DTM_SETFORMAT message (Commctrl.h)
Sets the display of a date and time picker (DTP) control based on a given format string. You can send this message explicitly or use the DateTime\_SetFormat macro.
a89fa3ad-9894-4c52-ab56-fb62208e39b3
DTM_SETFORMAT message Windows Controls
apiref
DTM_SETFORMAT
DTM_SETFORMATA
DTM_SETFORMATW
Commctrl.h
HeaderDef
reference
05/31/2018

DTM_SETFORMAT message

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

Parameters

wParam

Must be zero.

lParam

A pointer to 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.

Return value

Returns nonzero if successful, or zero otherwise.

Remarks

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".

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.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Commctrl.h
Unicode and ANSI names
DTM_SETFORMATW (Unicode) and DTM_SETFORMATA (ANSI)