nl_langinfo

(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)

nl_langinfo Retorna informação de linguagem e local

Descrição

nl_langinfo ( int $item ) : string

Aviso

Esta função não está documentada; somente a lista de argumentos está disponível.

add a note add a note

User Contributed Notes 2 notes

up
2
avatar_at_hot_ee
18 years ago
The value MON_(1-12) has special behavior in Russian locale: it returns declinated month names, that can be used as part of a date string, but not on their own.

For instance instead of "Январь" (the proper nominative form) it returns "Января" (form declinated for use in dates).

There seems to be no way to get the nominative form of the month name - one has to use translations instead.
up
-1
mark at moderndeveloper dot com
10 years ago
If you are looking for the stand-alone (nominative form) of a month, you may not be able to use nl_langinfo(), but with PHP 5.5 you can use something like:

<?php
echo IntlDateFormatter::formatObject(
         new
DateTime('2013-01-01 00:00:00 Europe/Moscow'),
        
'LLLL',
        
'ru_RU');
?>

Note that the format uses the ICU patterns, not the PHP date() patterns.
To Top