I am new in php and i want to set current date in my HTMl date tag
<input type="date" value="Today">
How i can get current date?
To set and get the input type date in dd-mm-yyyy format we will use <input> type attribute. The <input> type attribute is used to define a date picker or control field. In this attribute, you can set the range from which day-month-year to which day-month-year date can be selected from.
You've got the right idea. It's just out of order: <input type="text" name="frmDateReg" required id="frmDate" value=""> function getDate(){ var todaydate = new Date(); var day = todaydate. getDate(); var month = todaydate.
Try using date
function as
<input type="date" value="<?php echo date('Y-m-d');?>">
You need to follow standard Y-m-d
format
<input type="date" name="current_date" value="<?php echo date("Y-m-d") ?>">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With