An application sends a ZGM_GETREGDATEFORMATTED message to get the specified text representation of the date in the internal date register.
ZGM_GETREGDATEFORMATTED
wParam = (WPARAM) (int) iDateFormat; //date format number
lParam = (LPARAM) lpszString; //pointer to string to return the text representation of a date
For example, the date 'February 3, 1965' will be returned as follows for the given formats:
The string must be previously allocated and have a minimum length of 19 characters. Failure to preallocate this string will result in undefined behavior, possibly resulting in data loss and/or program crash.
A string of 19 characters is needed to hold the longest formatted date that could possibly be returned. That would be 'September DD, YYYY' and is 18 characters in length. One character is needed for the null termination, thus needing a length of at least 19 characters.
This message returns TRUE if the date in the internal date register is valid, otherwise it returns FALSE.