Show date and time to current user

0

I have this code:

while($rows_cursos = mysqli_fetch_array($resultado_cursos)) {

$tabela1 .= '<td> <input type="date" name= "Data[]" id= "Data" value="<?php echo date("Y-m-d");?> <input type="time" required="" id="Hora" name="Hora[]" value="<?php echo date("H:i:s");?></td>';
}

But it does not show the current date or the current time as shown in the image:

    
asked by anonymous 11.04.2018 / 13:24

1 answer

3

You must concatenate:

$tabela1 .= '<td> <input type="date" name= "Data[]" id= "Data" value="'. date("Y-m-d") .'"> <input type="time" required="" id="Hora" name="Hora[]" value="' . date("H:i:s") . '"></td>';
    
11.04.2018 / 13:38