Answers for "script to change date input format"

1

change date format in html

<input type="date" name="begin" 
    placeholder="dd-mm-yyyy" value=""
    min="1997-01-01" max="2030-12-31">
Posted by: Guest on April-05-2021
1

set date to input date

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;
Posted by: Guest on September-26-2021

Code answers related to "script to change date input format"

Browse Popular Code Answers by Language