Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Cristiano Severino

[Resolvido] Strict Standards: date() [function.date]:

Recommended Posts

Caros,

 

Estou com o erro abaixo no meu site.

Tentei fazer algumas coisa que achei na net mais nada funcionou.

Abixo do erro segue o php

 

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '-2.0/DST' instead in C:\AppServ\www\BluTI\config.php on line 5

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '-2.0/DST' instead in C:\AppServ\www\BluTI\config.php on line 6

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '-2.0/DST' instead in C:\AppServ\www\BluTI\config.php on line 7

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '-2.0/DST' instead in C:\AppServ\www\BluTI\config.php on line 8

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '-2.0/DST' instead in C:\AppServ\www\BluTI\config.php on line 10

Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '-2.0/DST' instead in C:\AppServ\www\BluTI\config.php on line 14

Segue PHP

 

 

?php
$titulo = "BluTI Soluções em TI";
$ip_usuario = " ";
//$ip_usuario = $REMOTE_ADDR;
$data_hora = date("YY/m/d H:i:s");
$data = date("d/m/Y");
$hora = date("H:i:s");
$dia = date("d")-1;
$dia +=1;
$mes = date("m")-1;
$meses = array

("","Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","D

ezembro");
$semanas = array("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado");
$mes += 1;
$ano = date("Y");



//Configuração local

$db_host = "localhost";
$db_usuario = "root";
$db_senha = "root";
$db_banco = "bluti";

$conexao = mysql_connect($db_host,$db_usuario,$db_senha) or die ("Não foi possivel conectar ao servidor MySQL"); 

//conecta ao mysql
mysql_select_db($db_banco, $conexao);

function PreparaMsg ($var,$op){
if($var==""){ $var=" "; };
if($op=="htm_dec"){
	$var = nl2br($var);
	$trans = get_html_translation_table(HTML_ENTITIES);
	$var = strtr($var, $trans);
	$trans = array_flip($trans);
	$var = strtr($var, $trans);
}
if($op=="htm_enc"){
	$var = htmlentities($var);
	$var = nl2br($var);
}
return $var;	
}


function censurar($texto){
 $censura[0]="'<script[^>]*?>.*?</script>'si";		 $troca[0]="";
 $censura[1]="'<[\/\!]*?[^<>]*?>'si";				 $troca[1]="";
 $censura[2]="'([\r\n])[\s]+'";						 $troca[2]="";
 $censura[3]="'&(quot|#34);'i";						 $troca[3]="";
 $censura[4]="'&(amp|#38);'i";						 $troca[4]="";
 $censura[5]="'&(lt|#60);'i";						 $troca[5]="";
 $censura[6]="'&(gt|#62);'i";						 $troca[6]="";
 $censura[7]="'&(nbsp|#160);'i";					 $troca[7]="";
 $censura[8]="'&(iexcl|#161);'i";					 $troca[8]="";
 $censura[9]="'&(cent|#162);'i";					 $troca[9]="";
$censura[10]="'&(pound|#163);'i";					$troca[10]="";
$censura[11]="'&(copy|#169);'i";					$troca[11]="";
$censura[12]="'(\d+);'e";							$troca[12]="";
$censura[13]="'http:[^>]*?([a-z0-9.]+)'i";			$troca[13]="";
$censura[14]="'www[^>]*?([a-z0-9.]+)'i";			$troca[14]="";
$censura[15]="'([a-z0-9.]+)@([a-z0-9.]+)'i";		$troca[15]="";
$censura[16]="'v[ie]ado'i";							$troca[16]="";
$censura[17]="'filho[^>]*?#@?$%~'i";					$troca[17]="";
$censura[18]="'bosta'i";							$troca[18]="";
$censura[19]="'#@?$%~'i";								$troca[19]="";
$censura[20]="'dando'i";							$troca[20]="";
$censura[21]="'rabo'i";								$troca[21]="";
$censura[22]="'bucet[^>]*?([a-z]+)'i";				$troca[22]="";
$texto = preg_replace($censura,$troca,$texto);
$texto = preg_replace('/\s\s+/', ' ', $texto);
return $texto;
}

function validaPasta($var){
$a="ÁáÉéÍíÓóÚúÇçÃãÀàÂâÊêÎîÔôÕõÛû& -!@#$%¨&*()_+}=}{[]^~?/:;><,'´`\"";
$b="AaEeIiOoUuCcAaAaAaEeIiOoOoUue_________________________________";
$var = strtr($var,$a,$B);				
$var = strtolower($var);	
return $var;
}

function imageResize($origem,$destino,$tamanho,$texto){
$originalImage = imagecreatefromjpeg($origem);
$originalWidth = imagesx($originalImage); 
$originalHeight = imagesy($originalImage); 
if ($originalWidth > $originalHeight){ 
	$novoWidth = $tamanho; 
	$novoHeight = ($originalHeight * $tamanho)/$originalWidth;
} else {
	$novoHeight = $tamanho; 
	$novoWidth = ($originalWidth * $tamanho)/$originalHeight; 
} 
if(function_exists('imagecopyresampled')){
	if(function_exists('imageCreateTrueColor')){
		$novaImagem = imageCreateTrueColor($novoWidth,$novoHeight); 
	} else {
		$novaImagem = imagecreate($novoWidth,$novoHeight);
	}
	if(!@imagecopyresampled($novaImagem,$originalImage,0,0,0,0,$novoWidth,$novoHeight,$originalWidth,

$originalHeight)){
		imagecopyresized($novaImagem,$originalImage,0,0,0,0,$novoWidth,$novoHeight,$originalWidth,

$originalHeight);
	}
} else {
	$novaImagem = imagecreate($novoWidth,$novoHeight);
	imagecopyresized($ni,$im,0,0,0,0,$novoWidth,$novoHeight,$originalWidth,$originalHeight);
}
if($texto){
	$h = imagefontheight($font);
	$fw = imagefontwidth($font);
	$cor = imagecolorallocate($novaImagem,255,255,255);
	$cor2 = imagecolorallocate($novaImagem,0,0,0);
	imagerectangle($novaImagem,0,0,$novoWidth,$novoHeight,$cor2);
	imagefilledrectangle($novaImagem,0,($novoHeight-15),$novoWidth,$novoHeight,$cor2);
	imagestring($novaImagem,2,5,($novoHeight-15),$texto,$cor);
}
imagejpeg($novaImagem,$destino,80);
}

function somadata($dias){ 
$dia = date("d"); 
$mes = date("m"); 
$ano = date("Y"); 
$i = $dias; 
for($i = 0;$i<$dias;$i++){
	if ($mes == 01 || $mes == 03 || $mes == 05 || $mes == 07 || $mes == 08 || $mes == 10 || $mes == 

12){ 
		if($mes == 12 && $dia == 31){ 
			$mes = 01; 
			$ano++; 
			$dia = 00; 
		} 
		if($dia == 31 && $mes != 12){ 
			$mes++; 
			$dia = 00; 
		} 
	}
	if($mes == 04 || $mes == 06 || $mes == 09 || $mes == 11){ 
		if($dia == 30){ 
			$dia =  00; 
			$mes++; 
		} 
	}
	if($mes == 02){ 
		if($ano % 4 == 0){
			if($dia == 29){ 
				$dia = 00; 
			} 
		} else { 
			if($dia == 28){ 
				$dia = 00; 
			} 
		} 
	}

	$dia++; 
}
$data_volta = $ano."-".$mes."-".$dia; 
return $data_volta; 
}

function corrigeData($i){
$i = split("-",$i);
$i = $i[2]."/".$i[1]."/".$i[0];
return $i;
}

function pegaSemana($dt){
$dt = split("-",$dt);
return(date("w", mktime(0, 0, 0, $dt[1], $dt[2], $dt[0])));
}

function totalDias($dt){
$dt = split("-",$dt);
return(date("t", mktime(0, 0, 0, $dt[1], $dt[2], $dt[0])));
}

?>

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Desde o PHP 5.1.o você deve setar um timezone para ser usado com as operações de Data/Hora.

 

Você deve setar um válido via date_default_timezone_set() ou setar direto pelo PHP.INI, na diretiva date.timezone.

 

Porém essa segunda alternativa só é possível no seu Servidor Local ou em Servidores Remotos dedicados.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bruno,

 

Posso colocar esse comando dentro do meu arquivo config.php?

 

<?php
date_default_timezone_set('America/Los_Angeles');

$script_tz = date_default_timezone_get();

if (strcmp($script_tz, ini_get('date.timezone'))){
   echo 'Script timezone differs from ini-set timezone.';
} else {
   echo 'Script timezone and ini-set timezone match.';
}
?>

Ai irá resolver?

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.