Set current date in Input type Date

0

I want to set the current date in this input type date; using this way with php it just gives the value of the current date, but viewing shows only dd / mm / yyyy, but inspecting the code the value of the "value" is with the current date. Can someone help me?

 <input class='col-4' type='date' name='Dsaida' id='DSaida' value='<?php echo date("d/m/Y"); ?>'>
    
asked by anonymous 26.07.2018 / 21:47

1 answer

1

You should pass the date on the defaults defined in RFC 3339 < a>, like this:

 <input class='col-4' type='date' name='Dsaida' id='DSaida' value='<?php echo date("Y-m-d"); ?>'>

The RFC 3339 is a ISO 8601 , and it defines a format for representing dates and times for the internet using the Gregorian calendar.

    
26.07.2018 / 21:51