Sei sulla pagina 1di 4

Cdigo fuente de 'Fecha y hora.

php'
<html> <head> <title>Fecha y hora</title> </head> <body style="font-family: Arial; font-size: 9pt"> <center><b><font face="Arial" size="3">Fecha y hora</font></b></center> <br><br> <?php // melbdate.php3// rename file extension from .txt to .php3// or to .php (updated April 2003) // // // // // // // // // // // // // // // // // // // Script copyright (C) 2000 Dean Kennedy, Terrabyte Communications Version 1.02 06 November 2003 Free to use, modify and copy so long as you leave the above two lines in comments. You can safely delete all other comments and just leave the four line script Distributed under the terms of the GNU General Public License (GPL). Because it is licensed free of charge, there is NO WARRANTY, it is provided AS IS. The author can not be held liable for any damage that might arise from the use of this software. Use it at your own risk. http://www.gnu.org/copyleft/gpl.html To adjust the format of the date, see the list of variables at the official PHP site (php.net): http://www.php.net/manual/function.date.php If your local time is *behind* the server time, then change the "+" to a "-" in the $melbdate line Keep in mind that you'll have to update the $hourdiff variable within the script when your *local* daylight saving time/standard time changes, if it is a different setting to the server daylight saving/standard time

// Variable for hours $hourdiff = "1"; // hours difference between server time and local time // If you don't know how many hours, then "uncomment" the three lines // below by deleting "// " to see what the server time is (remember to // put the comments "// " back when you've finished checking: // $serverdate = date("l, d F Y h:i a"); // print ("$serverdate"); // print (" &nbsp; <p>"); // Nothing needs to be changed below here unless you want to change // the format of the date (see above for URL of options) or your local // time is behind the server time $timeadjust = ($hourdiff * 60 * 60); $melbdate = date("l, d F Y h:i a",time() + $timeadjust); print ("$melbdate"); ?> </body> </html>

Cdigo fuente de 'Fecha y hora en espanyol.php'


<html> <head> <title>Fecha y hora en espaol</title> </head> <body style="font-family: Arial; font-size: 9pt"> <center><b><font face="Arial" size="3">Fecha ey hora en espaol</font></b>

<br><br> <? /* Lnea a implementar si el servidor web no est en Europa y quieres que la fecha y hora sean europeas */ putenv('TZ=Europe/Madrid'); /* Script en PHP para mostrar la fecha del servidor web en tus pginas */ /* Definicin de los meses del ao en castellano */ $mes[0]="-"; $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"; /* Definicin de los das de la semana */ $dia[0]="Domingo"; $dia[1]="Lunes"; $dia[2]="Martes"; $dia[3]="Mircoles"; $dia[4]="Jueves"; $dia[5]="Viernes"; $dia[6]="Sbado"; /* Implementacin de las variables que calculan la fecha */ $gisett=(int)date("w"); $mesnum=(int)date("m"); /* Variable que calcula la hora */ $hora = date(" H:i",time()); /* Presentacin de los resultados en una forma similar a la siguiente: Mircoles, 23 de junio de 2004 | 17:20 */ echo $dia[$gisett].", ".date("d")." de ".$mes[$mesnum]." de ".date("Y")." | ".$hora; ?> </center> </body> </html>

Cdigo fuente de 'Fecha y hora en espanyol.php'


<html> <head> <title>Fecha y hora en espaol</title> </head> <body style="font-family: Arial; font-size: 9pt"> <center><b><font face="Arial" size="3">Fecha ey hora en espaol</font></b> <br><br> <? /* Lnea a implementar si el servidor web no est en Europa y quieres que la fecha y hora sean europeas */ putenv('TZ=Europe/Madrid'); /* Script en PHP para mostrar la fecha del servidor web en tus pginas */ /* Definicin de los meses del ao en castellano */ $mes[0]="-"; $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"; /* Definicin de los das de la semana */ $dia[0]="Domingo"; $dia[1]="Lunes"; $dia[2]="Martes"; $dia[3]="Mircoles"; $dia[4]="Jueves"; $dia[5]="Viernes"; $dia[6]="Sbado"; /* Implementacin de las variables que calculan la fecha */ $gisett=(int)date("w"); $mesnum=(int)date("m"); /* Variable que calcula la hora */ $hora = date(" H:i",time()); /* Presentacin de los resultados en una forma similar a la siguiente: Mircoles, 23 de junio de 2004 | 17:20 */ echo $dia[$gisett].", ".date("d")." de ".$mes[$mesnum]." de ".date("Y")." | ".$hora; ?> </center> </body> </html>

Potrebbero piacerti anche