Skip to content
Advertisement

“ru_RU” (russian) setlocale not working on date and time

I am trying to use Russian language with setlocale:

setlocale(LC_TIME,"ru_RUS.utf8");
echo strftime("%A, %B %d", time());

Output is : Thursday, August 29

Expected is : четверг, Август 29

Any help would be highly appreciated.

Advertisement

Answer

Found it! if you are using Linux hosting then try:

setlocale(LC_ALL, 'ru_RU.UTF-8');

will works fine. In case you are using windows hosting then try:

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
setlocale(LC_ALL, 'russian');
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement