![]() ![]() The application can use the following elements to construct a format picture string. To obtain the time format without performing any actual formatting, the application should use the GetLocaleInfoEx function, specifying LOCALE_STIMEFORMAT. If "ttt" is passed in, the function assumes "tt". For example, the only time marker pictures that are valid are "t" and "tt". If more than two hour, minute, second, or time marker format pictures are passed in, the function defaults to two. The function returns no errors for a bad format string, but just forms the best possible time string. The function does not include milliseconds as part of the formatted time string. If TIME_FORCE24HOURFORMAT is specified, the function displays any existing time marker, unless the TIME_NOTIMEMARKER flag is also set. If TIME_NOTIMEMARKER is specified, the function removes the separators preceding and following the time marker. If TIME_NOMINUTESORSECONDS or TIME_NOSECONDS is specified, the function removes the separators following the minutes and/or seconds members. These include: wYear, wMonth, wDayOfWeek, and wDay. The function ignores the date members of the SYSTEMTIME structure. If any of the time values are outside the correct range, the function fails, and sets the last error to ERROR_INVALID_PARAMETER. The function checks each of the time values to determine that it is within the appropriate range of values. ![]() The time values in the structure indicated by lpTime must be valid. Examples of time markers are "AM" and "PM" for English (United States). If a time marker exists and the TIME_NOTIMEMARKER flag is not set, the function localizes the time marker based on the specified locale identifier. Not enough storage was available to complete this operation. The values supplied for flags were not valid. A supplied buffer size was not large enough, or it was incorrectly set to NULL. To get extended error information, the application can call GetLastError, which can return one of the following error codes: This function returns 0 if it does not succeed. If the cchTime parameter is set to 0, the function returns the size of the buffer required to hold the formatted time string, including a terminating null character. Returns the number of characters retrieved in the buffer indicated by lpTimeStr. ![]() ![]() In this case, the function returns the required size for the time string buffer, and does not use the lpTimeStr parameter. Alternatively, the application can set this parameter to 0. Size, in characters, for the time string buffer indicated by lpTimeStr. Pointer to a buffer in which this function retrieves the formatted time string. For information about the format picture string, see the Remarks section. If the application does not set the parameter to NULL, the function uses the locale only for information not specified in the format picture string, for example, the locale-specific time markers. If the application sets this parameter to NULL, the function formats the string according to the time format of the specified locale. Pointer to a format picture to use to format the time string. The application can set this parameter to NULL if the function is to use the current local system time. Pointer to a SYSTEMTIME structure that contains the time information to format. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |