---
name: "langinfo.h"
section: "0p"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/langinfo.h"
---

# langinfo.h(0p)

language information constants

## PROLOG

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

## NAME

langinfo.h — language information constants

## SYNOPSIS

```
#include <langinfo.h>
```

## DESCRIPTION

The *\<langinfo.h\>* header shall define the symbolic constants used to identify items of *langinfo* data (see *nl\_langinfo*()).

The *\<langinfo.h\>* header shall define the **locale\_t** type as described in *\<locale.h\>*.

The *\<langinfo.h\>* header shall define the **nl\_item** type as described in *\<nl\_types.h\>*.

The *\<langinfo.h\>* header shall define the following symbolic constants with type **nl\_item**. The entries under **Category** indicate in which *setlocale*() category each item is defined.

| | | |
| --- | --- | --- |
| **Constant** | **Category** | **Meaning** |
| CODESET | *LC\_CTYPE* | Codeset name. |
| D\_T\_FMT | *LC\_TIME* | String for formatting date and time. |
| D\_FMT | *LC\_TIME* | Date format string. |
| T\_FMT | *LC\_TIME* | Time format string. |
| T\_FMT\_AMPM | *LC\_TIME* | a.m. or p.m. time format string. |
| AM\_STR | *LC\_TIME* | Ante-meridiem affix. |
| PM\_STR | *LC\_TIME* | Post-meridiem affix. |
| DAY\_1 | *LC\_TIME* | Name of the first day of the week (for example, Sunday). |
| DAY\_2 | *LC\_TIME* | Name of the second day of the week (for example, Monday). |
| DAY\_3 | *LC\_TIME* | Name of the third day of the week (for example, Tuesday). |
| DAY\_4 | *LC\_TIME* | Name of the fourth day of the week |
|  |  | (for example, Wednesday). |
| DAY\_5 | *LC\_TIME* | Name of the fifth day of the week (for example, Thursday). |
| DAY\_6 | *LC\_TIME* | Name of the sixth day of the week (for example, Friday). |
| DAY\_7 | *LC\_TIME* | Name of the seventh day of the week |
|  |  | (for example, Saturday). |
| ABDAY\_1 | *LC\_TIME* | Abbreviated name of the first day of the week. |
| ABDAY\_2 | *LC\_TIME* | Abbreviated name of the second day of the week. |
| ABDAY\_3 | *LC\_TIME* | Abbreviated name of the third day of the week. |
| ABDAY\_4 | *LC\_TIME* | Abbreviated name of the fourth day of the week. |
| ABDAY\_5 | *LC\_TIME* | Abbreviated name of the fifth day of the week. |
| ABDAY\_6 | *LC\_TIME* | Abbreviated name of the sixth day of the week. |
| ABDAY\_7 | *LC\_TIME* | Abbreviated name of the seventh day of the week. |
| MON\_1 | *LC\_TIME* | Name of the first month of the year. |
| MON\_2 | *LC\_TIME* | Name of the second month. |
| MON\_3 | *LC\_TIME* | Name of the third month. |
| MON\_4 | *LC\_TIME* | Name of the fourth month. |
| MON\_5 | *LC\_TIME* | Name of the fifth month. |
| MON\_6 | *LC\_TIME* | Name of the sixth month. |
| MON\_7 | *LC\_TIME* | Name of the seventh month. |
| MON\_8 | *LC\_TIME* | Name of the eighth month. |
| MON\_9 | *LC\_TIME* | Name of the ninth month. |
| MON\_10 | *LC\_TIME* | Name of the tenth month. |
| MON\_11 | *LC\_TIME* | Name of the eleventh month. |
| MON\_12 | *LC\_TIME* | Name of the twelfth month. |
| ABMON\_1 | *LC\_TIME* | Abbreviated name of the first month. |
| ABMON\_2 | *LC\_TIME* | Abbreviated name of the second month. |
| ABMON\_3 | *LC\_TIME* | Abbreviated name of the third month. |
| ABMON\_4 | *LC\_TIME* | Abbreviated name of the fourth month. |
| ABMON\_5 | *LC\_TIME* | Abbreviated name of the fifth month. |
| ABMON\_6 | *LC\_TIME* | Abbreviated name of the sixth month. |
| ABMON\_7 | *LC\_TIME* | Abbreviated name of the seventh month. |
| ABMON\_8 | *LC\_TIME* | Abbreviated name of the eighth month. |
| ABMON\_9 | *LC\_TIME* | Abbreviated name of the ninth month. |
| ABMON\_10 | *LC\_TIME* | Abbreviated name of the tenth month. |
| ABMON\_11 | *LC\_TIME* | Abbreviated name of the eleventh month. |
| ABMON\_12 | *LC\_TIME* | Abbreviated name of the twelfth month. |
| 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* | Alternative 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, implementations may return the empty string ( **""**). |

If the locale's values for **p\_cs\_precedes** and **n\_cs\_precedes** do not match, the value of *nl\_langinfo*(CRNCYSTR) and *nl\_langinfo\_l*(CRNCYSTR,loc) is unspecified.

The following shall be declared as a function and may also be defined as a macro. A function prototype shall be provided.

```
char *nl_langinfo(nl_item);
char *nl_langinfo_l(nl_item, locale_t);
```

Inclusion of the *\<langinfo.h\>* header may also make visible all symbols from *\<nl\_types.h\>*.

*The following sections are informative.*

## APPLICATION USAGE

Wherever possible, users are advised to use functions compatible with those in the ISO C standard to access items of *langinfo* data. In particular, the *strftime*() function should be used to access date and time information defined in category *LC\_TIME*. The *localeconv*() function should be used to access information corresponding to RADIXCHAR, THOUSEP, and CRNCYSTR.

## RATIONALE

None.

## FUTURE DIRECTIONS

None.

## SEE ALSO

*Chapter 7*, *Locale*, ***\<locale.h\>***, ***\<nl\_types.h\>***

The System Interfaces volume of POSIX.1‐2017, *nl\_langinfo()*, *localeconv()*, *strfmon()*, *strftime()*

## COPYRIGHT

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting\_bugs.html .
