**** Resolvido Erro de data

(Helder) #1

Olá Galera…
To precisando de uma ajuda!!!
Tenho um sistema que captura a data e hora atual, conforme script abaixo:
setlocale(LC_ALL, ‘portuguese’, ‘pt_BR’, ‘pt_br’, ‘ptb_BRA’);
$data = strtotime(date(“Y”));
$data_ext = strftime("%d de %B de %Y",$data);
No windows ta perfeito rodando certinho, mas na hora em que publico o sistema, que é num servidor Linux (Debian) apresenta esses erro:
Warning: date() [function.date]: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Sao_Paulo’ for ‘BRT/-3.0/no DST’ instead in /var/www/helder/data.php on line 3

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Sao_Paulo’ for ‘BRT/-3.0/no DST’ instead in /var/www/helder/data.php on line 3

Warning: strftime() [function.strftime]: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Sao_Paulo’ for ‘BRT/-3.0/no DST’ instead in /var/www/helder/data.php on line 4
04 de June de 2010
Alguém poderia me dar uma ajuda com isso?
Att
Helder

(Helder) #2

Resolvido.

Pra quem interessar seque os passos.
No debian apache padrão, como root.
#nano /etc/php5/apache2/php.ini
Procure a Linha.
;date.timezone =
Retire o ;(ponto e virgula) e acrescente Etc/GMT+3
Ficando assim:
date.timezone = Etc/GMT+3
Reinicie o apache .

/etc/init.d/apache2 restart

No meu caso ficou beleza.

Att.
Helder
Lá do Sul das Gerais!!!

Creditos:
Julio Cardoso
www.xjulio.info/blog

(Júlia Garbossa) #3

Helder,

Obrigada por compartilhar a SOLUÇÃO.

Tive o mesmo problema, e seguindo o que você passou deu tudo certo.

Valeu…

Júlia