C/C++ Date and Time Functions
size_t strftime(char *strDest, size_t maxsize, const char *format, const struct tm *timeptr);
size_t wcsftime(wchar_t *strDest, size_t maxsize, const wchar_t *format, const struct tm *timeptr);
size_t _tcsftime(TCHAR *strDest, size_t maxsize, const TCHAR *format, const struct tm *timeptr);
Internationalization (I18n) Function Overview
The strftime function formats the value in timeptr , interpreting the specifications in format according to the LC_TIME category of the current locale, and stores resulting string in strDest . The function ensures that no more than maxsize characters, including the terminating null character, are stored in the destination string, and returns either the number of characters stored, or 0 in the event of an error.
wcsftime is the wide-character version of strftime ; its arguments are wide-character strings, and it returns the number of wide characters stored.
_tcsftime is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either strftime or _wcsftime .
I18n Issues
Use the appropriate version of the function as required for internationalization support, noting the following:
Ensure that the current locale is set properly.
Recommended Function Replacements
C/C++ Date, Time, and Currency Functions
|