when entering the date and time in an issue it appears out of sync with the local time (only the time)

0
<?php
session_start();
    if (!isset($_SESSION['email'])) {
        header('Location: index.php');
    }

$fecha = date("Y-m-d H:i:s");

?>

<!DOCTYPE HTML>
<html>

<head>
    <title>ENCUESLAB</title>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Notable Feedback Form template Responsive, Login form web template,Flat Pricing tables,Flat Drop downs Sign up Web Templates, 
 Flat Web Templates, Login sign up Responsive web template, SmartPhone Compatible web template, free web designs for Nokia, Samsung, LG, SonyEricsson, Motorola web design">
    <script type="application/x-javascript">
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>
    <link href="css/font-awesome.css" rel="stylesheet">
    <link href="css/style-form.css" rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="css/jquery-ui.css"/>
    <link rel="stylesheet" href="css/font-awesome-form.css">
    <link href="//fonts.googleapis.com/css?family=PT+Sans+Caption" rel="stylesheet">
    <link href="//fonts.googleapis.com/css?family=Old+Standard+TT" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Amiri:400,400i,700,700i" rel="stylesheet">
    <link href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
    <link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet">

</head>
<body>

<div class="w3l-head">
<h1>Bienvenido</h1>
</div>
<div class="w3ls-form">
<form method="post" action="envia.php">

        <div class="w3l-last-grid1">
            <div class="w3l-grid1">
                <label class="text">Nombre Completo</label>
                <div class="w3l-div">
                    <i class="fa fa-user" aria-hidden="true"></i>
                    <input type="text" id="nombre" name="nombre" placeholder="Nombre Completo" required pattern="[a-zA-ZàáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'-]{2,48}">
                </div>
            </div>

            <div class="w3l-grid2">
            <label class="text">Fecha y Hora</label>
            <div class="w3l-div">
                <i class="fa fa-calendar" aria-hidden="true"></i>
                <input type="text" name="fecha" placeholder="Fecha" required value="<?= $fecha; ?>" id="fecha
                " readonly=”readonly”>
            </div>
            </div>
            <div class="clear"></div>
        </div>


        <div class="w3l-last-grid1">

            <div class="w3l-grid2">
                <label class="text">Fecha de Cumpleaños</label>
                <div class="w3l-div">
                    <i class="fa fa-calendar" aria-hidden="true"></i>
                    <input type="text" class="date" id="date" name="cumple" placeholder="0000-00-00" required maxlength="30" size="10">
                </div>  
            </div>  
            <div class="w3l-grid1">
                <label class="text">Email</label>
                <div class="w3l-div">
                    <i class="fa fa-envelope-o"></i>
                    <input type="email" id="email" name="email" placeholder="e-mail" required pattern="^[a-zA-Z0-9.!#$%&’*+/=?^_'{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" title="Debe ingresar un correo por ejemplo [email protected]">
                </div>
            </div>
            <div class="clear"></div>
        </div>


        <div class="w3l-last-grid1">


            <div class="clear"></div>
        </div>




        <div class="w3l-right-grid1">
        <div class="w3l-grid1">
                <label class="text">Mesa</label>
                <div class="w3l-div">
                    <i class="fa fa-book" aria-hidden="true"></i>
                    <input type="text" id="mesa" name="mesa" placeholder="Mesa" required pattern="[1-9]"/>
                </div>
            </div>  
            <label class="text">Nos recomendaria</label>
            <div class="w3l-grid2">
                <div class="w3l-div">
                    <i class="fa fa-book" aria-hidden="true"></i>
                    <select class="form-contro2" name="respuesta" id="respuesta" required>
                        <option>Selecciona opcion</option>
                        <option>SI</option>
                        <option>NO</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <div class="w3ls-submit">
            <input type="submit" value="Enviar" id="envia">
        </div>
</form>
</div>
<footer>&copy; 2018 ENCUESLAB. Todos los derechos reservados | Design by <a href="https://twitter.com/Jesus_A_Cruz21?lang=es"> Jesus Alejandro</a></footer>
<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>


<!-- Calendar -->
<script src="js/jquery-ui.js"></script>




</body>

</html>
    
asked by Jac 16.10.2018 в 19:30
source

1 answer

0

You should check the server's timezone settings. Since PHP is loaded on the server side, the system time it handles is that of the server where it is executed. I suggest you review the method php_default_timezone_set() to change the configuration of the instance of PHP that is running.

    
answered by 16.10.2018 / 20:04
source