网站首页  词典首页

请输入您要查询的函数:

 

术语 gettimeformatex
释义 GetTimeFormatEx
语法:
int GetTimeFormatEx(
__in LPCWSTR lpLocaleName,
__in DWORD dwFlags,
__in const SYSTEMTIME *lpTime,
__in LPCWSTR lpFormat,
__out LPWSTR lpTimeStr,
__in int cchTime
);
GetTimeFormatEx功能
格式的时间,作为通过名称指定的语言环境的时间字符串。函数格式之一指定的时间和本地系统时间。
注意:应用程序应优先调用此函数来GetTimeFormat运行而设计的,如果仅在Windows Vista和更高版本。
注意:此功能可以改变数据格式之间的版本,例如,由于自定义区域。如果应用程序必须坚持或传输数据,请参阅使用持久性本地化数据。
参数
lpLocaleName [in]
可选。指针区域的名称,或以下预定义值之一。
LOCALE_NAME_INVARIANT
LOCALE_NAME_SYSTEM_DEFAULT
LOCALE_NAME_USER_DEFAULT
dwFlags [in]
旗指定的时间格式选项。有关详细的定义看到GetTimeFormat dwFlags参数。
lpTime [in]
可选。指针一个SYSTEMTIME结构,它包含的信息以格式。应用程序可以将此参数设置为NULL,如果该函数使用当前本地系统时间。
lpFormat [in]
可选。指针图片的格式使用格式化时间字符串。如果应用程序设置此参数为NULL,则函数的格式字符串按照指定的地点时间格式。如果应用程序不设置参数为NULL,则函数只使用不为字符串中指定格式的图片资料的语言环境,例如,区域设置特定的时间标记。有关图片格式字符串信息,请参见备注部分。
lpTimeStr [out]
可选。缓冲区指针在本函数检索格式化的时间字符串。
cchTime [in]
大小,字符,字符串缓冲区时所指出的lpTimeStr。另外,应用程序可以设置为0参数。在这种情况下,该函数返回的时间字符串缓冲区所需的大小,以及不使用lpTimeStr参数。
返回值
返回检索的数目在缓冲区lpTimeStr显示字符。如果cchTime参数设置为0,则函数返回须持有格式化的时间字符串缓冲区,其中包括终止空字符的大小。
这个函数返回0,如果没有成功。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INSUFFICIENT_BUFFER。阿提供的缓冲区大小不够大,或者被错误地设置为NULL。
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
ERROR_OUTOFMEMORY。没有足够的存储是可用于完成此操作。
备注
见GetTimeFormat备注。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
国家语言支持
国家语言支持功能
GetDateFormatEx
GetLocaleInfoEx
GetTimeFormat
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==GetTimeFormatEx Function
Formats time as a time string for a locale specified by name. The function formats either a specified time or the local system time.
Note The application should call this function in preference to GetTimeFormat if designed to run only on Windows Vista and later.
Note This function can format data that changes between releases, for example, due to a custom locale. If your application must persist or transmit data, see Using Persistent Locale Data .
Syntax
int GetTimeFormatEx(
__in LPCWSTR lpLocaleName,
__in DWORD dwFlags,
__in const SYSTEMTIME *lpTime,
__in LPCWSTR lpFormat,
__out LPWSTR lpTimeStr,
__in int cchTime
);
Parameters
lpLocaleName [in]
Optional. Pointer to a locale name , or one of the following predefined values.
LOCALE_NAME_INVARIANT
LOCALE_NAME_SYSTEM_DEFAULT
LOCALE_NAME_USER_DEFAULT
dwFlags [in]
Flags specifying time format options. For detailed definitions see the dwFlags parameter of GetTimeFormat .
lpTime [in]
Optional. Pointer to a SYSTEMTIME structure that contains the time information to format. The application can set this parameter to NULL if the function is to use the current local system time.
lpFormat [in]
Optional. Pointer to a format picture to use to format the time string. If the application sets this parameter to NULL, the function formats the string according to the time format of the specified locale. 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. For information about the format picture string, see the Remarks section.
lpTimeStr [out]
Optional. Pointer to a buffer in which this function retrieves the formatted time string.
cchTime [in]
Size, in characters, for the time string buffer indicated by lpTimeStr. Alternatively, the application can set this parameter to 0. In this case, the function returns the required size for the time string buffer, and does not use the lpTimeStr parameter.
Return Value
Returns the number of characters retrieved in the buffer indicated by lpTimeStr. 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.
This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError , which can return one of the following error codes:
ERROR_INSUFFICIENT_BUFFER. A supplied buffer size was not large enough, or it was incorrectly set to NULL.
ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
ERROR_OUTOFMEMORY. Not enough storage was available to complete this operation.
Remarks
See Remarks for GetTimeFormat .
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinnls.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
National Language Support
National Language Support Functions
GetDateFormatEx
GetLocaleInfoEx
GetTimeFormat
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd318131(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:21:46