Date format conversion in Javascript
i have coded to convert the date format dd/mm/yyyy to ddmmyyyy in javascript but its not working . i have attached my snippet here, kindly tell me what mistake i have done here.
<html> <body> <input type="date" id="id1"/> <button onclick="myfunction()">click me</button> <p id="id2"></p> <script> function myfunction() { var date=document.getElementById("id1").value; date=date.format('DDMMYYYY'); document.getElementById("id2").innerHTML=date; } </script> </body> </html>
0