I'm looking for the field:
<input type="date" id="fecha" name="fecha"
Type date show the current system date, thanks.
I'm looking for the field:
<input type="date" id="fecha" name="fecha"
Type date show the current system date, thanks.
<input type="datetime" name="fecha" value="<?php echo date("Y-m-d\TH-i");?>">
You could try my estimate with the previous code.
Hello, in case you are not working with a local server, you can also do it with js with this code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$( document ).ready(function() {
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
$("#fecha").val(today);
});
</script>
greetings
You can try this code, using the ** date '* php
<input type="date"
id="txtfecha"
name="txtfecha"
class="form-control"
value="<?php echo date("Y-n-j"); ?>"
required/>