I have a small problem. I have a form where I wish the time were to be written automatically, but I do not know how to do. I tried with:
<input type="time"/>
but the time is not inserted automatically. Does anybody know how to help me? Thanks!
The topic has been already discussed here, use the Javascript Date() object. A description can be found on the MDN website.
The time type is not fully compatible yet, regardless if you want it to read the current date/time as of the time of execution you must populate the field from javascript.
<input type="time" id="time">
<script>
document.getElementById("time").value = Date();
</script>
Perhaps:
<body>
time: <input type="time" id='now'/>
<script>document.getElementById('now').value = Date().toString();</script>
</body>
Use toDateString() instead of toString() if you only want the date.