Untitled
unknown
plain_text
2 years ago
420 B
6
Indexable
<script> const dateInput = document.getElementById('as_on_date'); const currentDate = new Date(); const year = currentDate.getFullYear(); const month = ('0' + (currentDate.getMonth() + 1)).slice(-2); // add leading zero and slice last two characters const day = ('0' + currentDate.getDate()).slice(-2); // add leading zero and slice last two characters dateInput.value = `${day}-${month}-${year}`; </script>
Editor is loading...