سؤال

php -r 'setlocale(LC_ALL, "ru"); echo date("F", time()), "\n";' prints "June" in English despite of the fact that I have set Russian locale.

Why does it not work as I need (with Russian month names)?

هل كانت مفيدة؟

المحلول

You will need to use strftime instead of date to format a date taking into account locale.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top