简体   繁体   中英

PHP: setlocale() does not work

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)?

您需要使用strftime而不是date来格式化考虑区域设置的日期。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM