html - How to get the browser current date? -
i use html5 , want user browser current date how can ?
i tried use code doesn't work
date: <br/><input type="date" name="aday" min='atetime.utcnow.tostring("u")' >
<input type="date" min="" id="demo" />
you can use in javascript.
var d = new date(); date = d.getfullyear() + "-" + ("0" + d.getmonth()).slice(-2) + "-" + ("0" + d.getdate()).slice(-2);
date
value html input tag (min attribute) can use document.getelementbyid("demo").attributes["min"] = date;
Comments
Post a Comment