Show value in input of type datetime-local

0

I have this code:

$tabela5 .= '<td> <input type="datetime-local" name= "DataInicio" id= "DataInicio" value="'. date("Y-m-d H:i:s") .'"></td>';

But the input does not show the current date and time.

    
asked by anonymous 12.10.2018 / 14:04

1 answer

1

Switch to this:

date("Y-m-d\TH:i:s")

HTML should have a T between the date and time. \ is to escape it

    
12.10.2018 / 14:12