Javascript examples for Date:constructor
Get current date
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* w ww. j a va2 s .co m*/ var d = new Date(); var month = d.getMonth()+1; var day = d.getDate(); var output = d.getFullYear() + '/' + month + '/' + day; console.log(output); } </script> </head> <body> </body> </html>