Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Formats the supplied date using the specified formatting options.
Syntax
HRESULT formatDate( VARIANT varDate, BSTR bstrFormat, VARIANT varDestLocale, BSTR * pbstrFormattedString);
Parameters
- varDate
- [in] Date that is to be formatted.
- bstrFormat
- [in] Formatting specifics. The following codes are supported:
- m
- Months as 1-12
- mm
- Months as 01-12
- mmm
- Months as Jan-Dec
- mmmm
- Months as January-December
- mmmmm
- Months as the first letter of the month
- d
- Days as 1-31
- dd
- Days as 01-31
- ddd
- Days as Sun-Sat
- dddd
- Days as Sunday-Saturday
- yy
- Years as 00-99
- yyyy
- Years as 1900-9999
- varDestLocale
- [in] Locale to use in determining the correct sequence to be used in the date. If not supplied, uses the sequence month-day-year.
- pbstrFormattedString
- [out] String containing the date in the requested format.
Return Value
Returns S_OK if successful, or an error code otherwise.
See Also
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.