Browse Source

Mejor Impresión de resultado

Alejandro Rosales 1 year ago
parent
commit
0144aeb26f
1 changed files with 5 additions and 2 deletions
  1. 5 2
      index.php

+ 5 - 2
index.php

@@ -20,8 +20,11 @@ try {
     // Obtener el resultado
     $result = $stmt->fetch(PDO::FETCH_ASSOC);
 
-    // Imprimir el resultado
-    echo "Current date and time: {$result['now']}";
+    ?>
+    <p>
+        Current date and time: <time datetime="<?= $result['now'] ?>">
+    </p>
+    <?php
 } catch (PDOException $e) {
     // Manejo de errores
     echo "Error: {$e->getMessage()}";