Internationalization and localization tools


C/C++ Date and Time Functions

char *_strtime(char *timestr);

wchar_t *_wstrtime(wchar_t *timestr);

TCHAR *_tstrtime(TCHAR *timestr);

Internationalization (I18n) Function Overview

The _strtime function copies the current local time into the buffer pointed to by timestr and returns a pointer to the string.

_wstrtime is the wide-character version of the function; its parameter and return value are wide-character strings.

_tstrtime is the Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _strtime or _wstrtime.

I18n Issues

Use the appropriate version of the function as required for internationalization support, noting the following:

These functions should be avoided in an internationalized application since they assume hh:mm:ss for the format, which may be unacceptable in some locales. However, its worth noting that in some limited instances they still may be useful. For example, for debugging, or for writing to log files or consoles that will not be viewed by the end user.

Minimally, use strftime or wcsftime since they format dates and times using the LC_TIME category of the current locale. Or, for a more comprehensive solution, consider using the ICU package and its Date/Time formatting functions.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

C/C++ Date, Time, and Currency Functions

 

 

Lingoport internationalization and localization services and software