Muestra del código PHP Ejercicio 5
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>CFGS - Desarrollo de Aplicaciones Web</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f4f6f9;
margin: 0;
padding: 0;
}
header {
background: #F59C27;
color: white;
padding: 15px;
text-align: center;
}
h1 {
margin: 0;
}
main {
max-width: 1000px;
margin: 30px auto;
padding: 20px;
background: white;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
ul {
list-style: none;
padding: 0;
}
footer{
margin: auto;
background-color: #F59C27;
text-align: center;
height: 150px;
color: white;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
}
main{
text-align:center;
justify-content:center;
}
a{
text-decoration: none;
color:purple;
}
table{
border-collapse: collapse;
width: 100%;
border-width: 4px;
}
td{
padding: 10px;
border-width: 4px;
}
#encabezado{
background-color: lightsteelblue;
font-weight: bold;
}
.codigos{
background-color: lightblue;
}
.mostrar{
background-color: lightsalmon;
}
tr{
height: 80px;
}
</style>
</head>
<body>
<header>
<h1><b>UT3: CARACTERÍSTICAS DEL LENGUAJE PHP</b></h1>
<a href="../../AMNDWESProyectoDWES/indexProyectoDWES.php">Alberto Méndez Núñez | 03/10/2025</a>
<p>Curso 2025/2026 - Grupo DAW2</p>
</header>
<main>
<h2><b>Ejercicio 05</b></h2>
<?php
/*
* Autor: Alberto Méndez Núñez
* Fecha de ultima modificación: 10/10/2025
*
*/
// Establece la zona horaria a utilizar para las funciones relacionadas con fecha y hora.
// En este caso se configura la zona horaria de Madrid (España).
date_default_timezone_set("Europe/Madrid");
// Crea un nuevo objeto DateTime que contiene la fecha y hora actuales,
// tomando como referencia la zona horaria previamente definida.
$timestamp=new DateTime();
// Imprime un mensaje seguido del valor del timestamp actual.
// getTimestamp() devuelve el tiempo UNIX: el número de segundos transcurridos
// desde el 1 de enero de 1970 a las 00:00:00 UTC.
echo "Fecha actual con 'timestamp': ".$timestamp->getTimestamp();
?>
</main>
</body>
</html>