If you are using the MySQL database, the problem must be in the lc_time_names
variable. To verify, use the following statement:
SELECT @@lc_time_names;
The return should look something like this:
+-----------------+
| @@lc_time_names |
+-----------------+
| en_US |
+-----------------+
1 row in set (0.00 sec)
en_US
is the default value in MySQL and this is probably your problem. To change it to pt_BR
, execute the statement:
SET lc_time_names = 'pt_BR';
In this way, when checking the value of the variable again, the return will be:
+-----------------+
| @@lc_time_names |
+-----------------+
| pt_BR |
+-----------------+
1 row in set (0.00 sec)
And so, if you test with the date:
SELECT DATE_FORMAT(CURDATE(), '%d de %M de %Y');
Your return will be:
+-------------------------------------------------+
| SELECT DATE_FORMAT(CURDATE(), '%d de %M de %Y') |
+-------------------------------------------------+
| 05 de fevereiro de 2017 |
+-------------------------------------------------+
1 row in set (0.00 sec)
Notice the date in Portuguese. However, when you close the session with MySQL, the variable will return to its default value, requiring you to update to pt_BR
each time you connect to the database. To work around this problem, you can set the variable in global scope, with the statement:
SET GLOBAL lc_time_names=pt_BR;
But I do not know if defining it globally brings some risk to your application.