Topic: setlocale (LC_TIME, null) returns "C"
Debian 8 + php 5.6 . In system all are installed necessary :
LC_CTYPE = "ru_RU.UTF-8"
LC_NUMERIC = "ru_RU.UTF-8"
LC_TIME = "ru_RU.UTF-8"
LC_COLLATE = "ru_RU.UTF-8"
LC_MONETARY = "ru_RU.UTF-8"
LC_MESSAGES = "ru_RU.UTF-8"
LC_PAPER = "ru_RU.UTF-8"
LC_NAME = "ru_RU.UTF-8"
LC_ADDRESS = "ru_RU.UTF-8"
LC_TELEPHONE = "ru_RU.UTF-8"
LC_MEASUREMENT = "ru_RU.UTF-8"
LC_IDENTIFICATION = "ru_RU.UTF-8"
Further in a php-code I check:
setlocale (LC_TIME, ' en_US.UTF-8 '); die (strftime (' %b %d, %Y %I: % M: % S %p ', time ()));//Dec 01, 2016 0:11:27 PM AM //setlocale (LC_TIME, null)//A C //setlocale (LC_ALL, null)//A C setlocale (LC_TIME, ' ru_RU.UTF-8 '); die (strftime (' %b %d, %Y %I: % M: % S %p ', time ()));//a deque 01, 2016 0:06:22 PM //setlocale (LC_TIME, null)//A C //setlocale (LC_ALL, null)//A C
In this code in both cases specified are correctly applied.
But thus " setlocale (LC_ALL, null) " in both cases returns "C". Why?
According to to help :
If in quality locale the blank line "" or NULL is transferred, names will be are taken from the variables of a surrounding with the same name or by a variable with a name "LANG" .
If in quality locale it is transferred NULL or "0", it will not be changed, and current value will be returned.
In this case we explicitly install LC_TIME , we check that it was correctly installed (is correctly used by function strftime ) and there and then we receive its value - but we receive "C". Why?