Internationalization and localization tools


C/C++ Date and Time Functions

char *asctime_r(const struct tm *brokentime, char *buffer);

Internationalization (I18n) Function Overview

This function is similar to asctime but is re-entrant since instead of placing the result in a static buffer, it writes the string in the buffer pointed to by the parameter buffer. This buffer should have room for at least 26 bytes, including the terminating null.

I18n Issues

This function should not be relied upon to print error messages in any language other than English, and furthermore it does not take locale into account when formatting the time string. For these reasons it should be avoided in an internationalized application. However, its worth noting that in some limited instances it 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 and also are re-entrant. 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