Updated: April 19, 2023 |
Get information about the language or cultural area defined in the current locale
#include <time.h> char *nl_langinfo( nl_item item );
Item | Type | Description |
---|---|---|
CODESET | LC_CTYPE | Codeset name |
D_T_FMT | LC_TIME | String for formatting the date and time |
D_FMT | LC_TIME | String for formatting the date |
T_FMT | LC_TIME | String for formatting the time |
T_FMT_AMPM | LC_TIME | a.m. or p.m. formatting string |
AM_STR | LC_TIME | Ante meridiem affix |
PM_STR | LC_TIME | Post meridiem affix |
DAY_1 through DAY_7 | LC_TIME | Name of the first through seventh day of the week |
ABDAY_1 through ABDAY_7 | LC_TIME | Abbreviated name of the first through seventh day of the week |
MON_1 through MON_12 | LC_TIME | Name of the first through twelfth month of the year |
ABMON_1 through ABMON_12 | LC_TIME | Abbreviated name of the first through twelfth month of the year |
ERA | LC_TIME | Era description segments |
ERA_D_FMT | LC_TIME | Era date format string |
ERA_D_T_FMT | LC_TIME | Era date and time format string |
ERA_T_FMT | LC_TIME | Era time format string |
ALT_DIGITS | LC_TIME | Alternate symbols for digits |
RADIXCHAR | LC_NUMERIC | Radix character |
THOUSEP | LC_NUMERIC | Separator for thousands |
YESEXPR | LC_MESSAGES | Affirmative response expression |
NOEXPR | LC_MESSAGES | Negative response expression |
CRNCYSTR | LC_MONETARY | Local currency symbol, preceded by - if the symbol should appear before the value, + if the symbol should appear after the value, or . if the symbol should replace the radix character. If the local currency symbol is the empty string, nl_langinfo() returns the empty string ( "" ). |
For information about the types, see setlocale().
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The nl_langinfo() function returns a pointer to a static string containing information relevant to the particular language or cultural area defined in the current locale.
A pointer to the requested string, or an empty string if the item couldn't be found.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | No |