Javascript examples for DOM HTML Element:Input Datetime Local
Input DatetimeLocal value Property - Get the local date and time of a datetime field:
<!DOCTYPE html> <html> <body> <input type="datetime-local" id="myLocalDate" value="2018-11-16T15:25:33"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from ww w. ja va2 s.c o m*/ var x = document.getElementById("myLocalDate").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>