6
I have the following code in PHP:
<?php
setlocale(LC_ALL, "pt_BR", "pt_BR.iso-8859-1", "pt_BR.utf-8", "portuguese");
$tz_object = new DateTimeZone('Brazil/East');
$datetime = new DateTime();
$datetime->setTimezone($tz_object);
$dia = $datetime->format('d');
$mes = $datetime->format('F');
$ano = $datetime->format('Y');
echo $dia . " de " . $mes . " de " . $ano;
?>
but the date comes in English:
10 de February de 2017
How can I adjust this ? I put a setlocale at the beginning of the code but did not resolve...
Check this solution: http://answall.com/questions/8317/como-fazer-a-fun%C3%A7%C3%A3o-date-formatar-uma-data-em-portugu%C3%Aas
– Thiago Santos