Jump to content

Date error HELP


darphas

Recommended Posts

hello i have a shared hosting in hostgator so, i cant change the default server clock.

 

then i code a script to show my local city date, but doesnt work. anyone can help me?

 

function muestrafecha($fecha){
$mes[1]="Enero";
$mes[2]="Febrero";
$mes[3]="Marzo";
$mes[4]="Abril";
$mes[5]="Mayo";
$mes[6]="Junio";
$mes[7]="Julio";
$mes[8]="Agosto";
$mes[9]="Septiembre";
$mes[10]="Octubre";
$mes[11]="Noviembre";
$mes[12]="Diciembre";
date_default_timezone_set("America/Monterrey");
return date("j",$fecha).' '.$mes[date("n",$fecha)].' '.date("Y",$fecha).'('.date("H:i:s",$fecha).')';
return $muestra;
}

the date works perfect, but the time zone appears + hour

Link to comment
https://forums.phpfreaks.com/topic/280917-date-error-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.